mirror of https://github.com/databricks/cli.git
acc: only print non-zero exit codes in errcode function (#2222)
Reduce noise in the output and matches how "Exit code" is handled for the whole script.
This commit is contained in:
parent
d784147e99
commit
d6d9b994d4
|
@ -1,8 +1,6 @@
|
||||||
|
|
||||||
>>> $CLI bundle validate -t development -o json
|
>>> $CLI bundle validate -t development -o json
|
||||||
|
|
||||||
Exit code: 0
|
|
||||||
|
|
||||||
>>> $CLI bundle validate -t error
|
>>> $CLI bundle validate -t error
|
||||||
Error: notebook this value is overridden not found. Local notebook references are expected
|
Error: notebook this value is overridden not found. Local notebook references are expected
|
||||||
to contain one of the following file extensions: [.py, .r, .scala, .sql, .ipynb]
|
to contain one of the following file extensions: [.py, .r, .scala, .sql, .ipynb]
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
|
|
||||||
>>> $CLI bundle validate -t development -o json
|
>>> $CLI bundle validate -t development -o json
|
||||||
|
|
||||||
Exit code: 0
|
|
||||||
|
|
||||||
>>> $CLI bundle validate -t error
|
>>> $CLI bundle validate -t error
|
||||||
Error: notebook this value is overridden not found. Local notebook references are expected
|
Error: notebook this value is overridden not found. Local notebook references are expected
|
||||||
to contain one of the following file extensions: [.py, .r, .scala, .sql, .ipynb]
|
to contain one of the following file extensions: [.py, .r, .scala, .sql, .ipynb]
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
>>> errcode $CLI bundle validate --var a=one -o json
|
>>> errcode $CLI bundle validate --var a=one -o json
|
||||||
|
|
||||||
Exit code: 0
|
|
||||||
{
|
{
|
||||||
"a": {
|
"a": {
|
||||||
"default": "hello",
|
"default": "hello",
|
||||||
|
|
|
@ -6,7 +6,9 @@ errcode() {
|
||||||
local exit_code=$?
|
local exit_code=$?
|
||||||
# Re-enable 'set -e' if it was previously set
|
# Re-enable 'set -e' if it was previously set
|
||||||
set -e
|
set -e
|
||||||
>&2 printf "\nExit code: $exit_code\n"
|
if [ $exit_code -ne 0 ]; then
|
||||||
|
>&2 printf "\nExit code: $exit_code\n"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
trace() {
|
trace() {
|
||||||
|
|
Loading…
Reference in New Issue