mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
exit 1 when a command does not exist (#4564)
This commit is contained in:
@@ -103,7 +103,10 @@ func Execute() int {
|
||||
|
||||
ctx := createRootContext()
|
||||
|
||||
rootCmd.ExecuteContext(ctx)
|
||||
err := rootCmd.ExecuteContext(ctx)
|
||||
if err != nil {
|
||||
exitCode = 1
|
||||
}
|
||||
return exitCode
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,13 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
[ $status -eq 0 ]
|
||||
}
|
||||
|
||||
@test "steampipe nonexistant pass with 1 exit code" {
|
||||
# this command should exit one since nonexistent does not exist
|
||||
run steampipe nonexistant
|
||||
echo $status
|
||||
[ $status -eq 1 ]
|
||||
}
|
||||
|
||||
function teardown_file() {
|
||||
# list running processes
|
||||
ps -ef | grep steampipe
|
||||
|
||||
Reference in New Issue
Block a user