File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,13 @@ export class GardenCli {
264
264
if ( cliOutput && errors . length < 1 ) {
265
265
logger . stop ( )
266
266
console . log ( cliOutput )
267
- process . exit ( parseResult . code )
267
+
268
+ // fix issue where sywac returns exit code 0 even when a command doesn't exist
269
+ if ( ! argv . h && ! argv . help ) {
270
+ code = 1
271
+ }
272
+
273
+ process . exit ( code )
268
274
}
269
275
270
276
const gardenErrors : GardenError [ ] = errors
Original file line number Diff line number Diff line change @@ -8,6 +8,17 @@ cd ${garden_root}/examples/hello-world
8
8
9
9
export GARDEN_LOGGER_TYPE=basic
10
10
11
+ # make sure CLI returns with error when it should
12
+ set +e
13
+
14
+ ${garden_bin} bla
15
+ if [[ $? -eq 0 ]]; then
16
+ echo " Expected error when calling with bad command"
17
+ exit 1
18
+ fi
19
+
20
+ set -e
21
+
11
22
${garden_bin} scan
12
23
${garden_bin} build
13
24
${garden_bin} deploy
You can’t perform that action at this time.
0 commit comments