Skip to content

Commit 4be28d9

Browse files
committed
Exit with non-zero code when deployment fails
Closes #205
1 parent 4f76549 commit 4be28d9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/commands/deploy.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ exports.handler = async (args = {}) => {
119119
if (!fs.existsSync(workdir)) {
120120
console.log(chalk.red(`Error! Path ${chalk.bold(workdir)} do not exists`));
121121
console.log('Please, check your arguments and try again.');
122+
process.exit(1);
122123
return;
123124
}
124125

@@ -149,6 +150,7 @@ exports.handler = async (args = {}) => {
149150
} catch (e) {
150151
spinner && spinner.fail('Your exoframe.json is not valid');
151152
console.log(chalk.red('Please, check your config and try again:'), e.toString());
153+
process.exit(1);
152154
return;
153155
}
154156

@@ -234,6 +236,7 @@ exports.handler = async (args = {}) => {
234236
if (e.statusCode === 401) {
235237
logout(userConfig);
236238
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
239+
process.exit(1);
237240
return;
238241
}
239242

@@ -251,5 +254,6 @@ exports.handler = async (args = {}) => {
251254
verbose && console.log('');
252255
verbose && console.log('Original error:', e);
253256
verbose > 1 && console.log('Original response:', e.response);
257+
process.exit(1);
254258
}
255259
};

0 commit comments

Comments
 (0)