Browse Source

fix: make error in action NOT ignored as it was meant before

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
cache-relation 1.5.16
Valentin Lab 3 years ago
parent
commit
12e7d39c90
  1. 7
      bin/compose-core

7
bin/compose-core

@ -87,6 +87,8 @@ $WHITE$exname$NORMAL reads '/etc/compose.conf' for global variables, and
#[[ "${BASH_SOURCE[0]}" == "" ]] && SOURCED=true #[[ "${BASH_SOURCE[0]}" == "" ]] && SOURCED=true
$(return >/dev/null 2>&1) && SOURCED=true $(return >/dev/null 2>&1) && SOURCED=true
errlvl() { return "${1:-1}"; }
export -f errlvl
if [ "$UID" == 0 ]; then if [ "$UID" == 0 ]; then
CACHEDIR=${CACHEDIR:-/var/cache/compose} CACHEDIR=${CACHEDIR:-/var/cache/compose}
@ -4272,6 +4274,10 @@ if [ -n "$full_init" ]; then
fi fi
fi | log fi | log
if [ "${PIPESTATUS[0]}" != 0 ]; then
exit 1
fi
if [ "$action" == "run" -a "${#services_args}" != 0 ]; then if [ "$action" == "run" -a "${#services_args}" != 0 ]; then
charm=$(get_service_charm "${services_args[0]}") || exit 1 charm=$(get_service_charm "${services_args[0]}") || exit 1
@ -4337,6 +4343,7 @@ case "$action" in
if [ "$is_service_action" ]; then if [ "$is_service_action" ]; then
run_service_action "$SERVICE_PACK" "$action" "${remainder_args[@]}" run_service_action "$SERVICE_PACK" "$action" "${remainder_args[@]}"
errlvl="$?" errlvl="$?"
errlvl "$errlvl"
else else
launch_docker_compose "${compose_opts[@]}" "$action" "${action_opts[@]}" "${action_posargs[@]}" "${remainder_args[@]}" launch_docker_compose "${compose_opts[@]}" "$action" "${action_opts[@]}" "${action_posargs[@]}" "${remainder_args[@]}"
fi fi

Loading…
Cancel
Save