From d52f948e469354eed14144c41a2550ca8ed3faa0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 29 Apr 2016 12:30:09 -0400 Subject: [PATCH] Use correct exit codes when running Etcher CLI with --robot (#384) Currently, the exit codes documented in the help section was not honoured if the CLI was ran with the `--robot` option. In this case, the CLI would exit with code 0 even if the validation failed. Signed-off-by: Juan Cruz Viotti --- lib/cli/etcher.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/cli/etcher.js b/lib/cli/etcher.js index 0138ebcc..52040842 100644 --- a/lib/cli/etcher.js +++ b/lib/cli/etcher.js @@ -78,14 +78,18 @@ form.run([ }).then(function(success) { if (options.robot) { - return console.log(`done ${success}`); + console.log(`done ${success}`); + } else { + if (success) { + console.log('Your flash is complete!'); + } else { + console.error('Validation failed!'); + } } if (success) { - console.log('Your flash is complete!'); process.exit(EXIT_CODES.SUCCESS); } else { - console.error('Validation failed!'); process.exit(EXIT_CODES.VALIDATION_ERROR); }