abort if codegen fails
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
2220054b4d
commit
8ef43abf25
1 changed files with 10 additions and 2 deletions
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
[ $# -eq 3 ] || __cdist_usage "<target host>" "<object_base_dir>" "<object>"
|
[ $# -eq 3 ] || __cdist_usage "<target host>" "<object_base_dir>" "<object>"
|
||||||
|
|
||||||
set -ue
|
set -u
|
||||||
|
|
||||||
export __cdist_target_host="$1"; shift
|
export __cdist_target_host="$1"; shift
|
||||||
export __cdist_object_base_dir="$1"; shift
|
export __cdist_object_base_dir="$1"; shift
|
||||||
|
@ -47,6 +47,7 @@ cd "$__cdist_object_dir"
|
||||||
|
|
||||||
# Call gencode of type with __cdist_object
|
# Call gencode of type with __cdist_object
|
||||||
if [ -x "$gencode" ]; then
|
if [ -x "$gencode" ]; then
|
||||||
|
# Prepend header to each script
|
||||||
cat << eof
|
cat << eof
|
||||||
#
|
#
|
||||||
# Code imported from $gencode
|
# Code imported from $gencode
|
||||||
|
@ -54,5 +55,12 @@ if [ -x "$gencode" ]; then
|
||||||
|
|
||||||
eof
|
eof
|
||||||
|
|
||||||
"$gencode"
|
"$gencode"; ret=$?
|
||||||
|
|
||||||
|
else
|
||||||
|
ret=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$ret" -ne 0 ]; then
|
||||||
|
__cdist_exit_err "Error: $gencode exited non-zero"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue