Skip to content

Commit 614c070

Browse files
committed
moved exit code to constants
1 parent 23ff984 commit 614c070

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

bin/commands/runs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ module.exports = function run(args, rawArgs) {
180180
await new Promise(resolve => setTimeout(resolve, 5000));
181181

182182
// download build artifacts
183-
if (exitCode != config.buildFailedExitCode) {
183+
if (exitCode != Constants.BUILD_FAILED_EXIT_CODE) {
184184
if (utils.nonEmptyArray(bsConfig.run_settings.downloads)) {
185185
await downloadBuildArtifacts(bsConfig, data.build_id, args, rawArgs);
186186
}
@@ -194,7 +194,7 @@ module.exports = function run(args, rawArgs) {
194194
let stacktraceUrl = getStackTraceUrl();
195195
await downloadBuildStacktrace(stacktraceUrl);
196196
logger.info(Constants.userMessages.BUILD_FAILED_ERROR)
197-
process.exitCode = Constants.ERROR_EXIT_CODE;
197+
process.exitCode = Constants.BUILD_FAILED_EXIT_CODE;
198198
}
199199
});
200200
} else if (utils.nonEmptyArray(bsConfig.run_settings.downloads)) {

bin/helpers/constants.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ const AUTH_REGEX = /"auth" *: *{[\s\S]*?}/g
218218

219219
const ERROR_EXIT_CODE = 1;
220220

221+
const BUILD_FAILED_EXIT_CODE = 3;
222+
221223
const REDACTED = "[REDACTED]";
222224

223225
const REDACTED_AUTH =`auth: { "username": ${REDACTED}, "access_key": ${REDACTED} }`;
@@ -241,5 +243,6 @@ module.exports = Object.freeze({
241243
LATEST_VERSION_SYNTAX_REGEX,
242244
ERROR_EXIT_CODE,
243245
AUTH_REGEX,
244-
REDACTED_AUTH
246+
REDACTED_AUTH,
247+
BUILD_FAILED_EXIT_CODE
245248
});

bin/helpers/sync/syncSpecsLogs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ let showSpecsStatus = (data) => {
169169
if (specDetails == "created") {
170170
return;
171171
} else if (specDetails["stacktrace_url"]) {
172-
specSummary.exitCode = config.buildFailedExitCode;
172+
specSummary.exitCode = Constants.BUILD_FAILED_EXIT_CODE;
173173
specSummary.buildError = specDetails["stacktrace_url"]
174174
winstonLogger.error(chalk.red(specDetails["message"]));
175175
} else {

0 commit comments

Comments
 (0)