Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/plugins/ExecuteJob/ExecuteJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ define([
// Download all files
this.result.addArtifact(info.resultHashes[name + '-all-files']);
// Parse the most precise error and present it in the toast...
const lastline = result.stdout.split('\n').filter(l => !!l).pop();
const lastline = result.stdout.split('\n').filter(l => !!l).pop() || '';
if (lastline.includes('Error')) {
this.onOperationFail(op, lastline);
} else {
Expand Down
13 changes: 9 additions & 4 deletions src/plugins/GenerateJob/templates/start.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var COMMAND_PREFIX = '<%= CONSTANTS.START_CMD %>',
IMAGE = '<%= CONSTANTS.IMAGE.PREFIX %>',
requirejs = require('webgme').requirejs,
remainingImageCount = 0,
exitCode = null;
exitCode;

requirejs([
'q',
Expand Down Expand Up @@ -79,7 +79,7 @@ requirejs([
});

var checkFinished = () => {
if (exitCode !== null && remainingImageCount === 0) {
if (exitCode !== undefined && remainingImageCount === 0) {
log('finished!');
cleanup();
}
Expand Down Expand Up @@ -221,8 +221,13 @@ requirejs([
log(`killing process group: ${pid}`);
process.kill(-pid, 'SIGTERM');
}
if (exitCode !== null) {
log(`exiting w/ code ${exitCode}`);
if (exitCode !== undefined) {
if (exitCode !== null) {
log(`exiting w/ code ${exitCode}`);
} else { // exited involuntarily
log(`script exited involuntarily (exit code is null)`);
return process.exit(1);
}
process.exit(exitCode);
}
};
Expand Down