From 3adb05d41dd7346c452359a694b629ce37c17272 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Mon, 17 Jul 2017 15:24:21 -0400 Subject: Avoid checking previous exit codes indirectly --- libs/project | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'libs/project') diff --git a/libs/project b/libs/project index d5c6dd1a..f18157de 100755 --- a/libs/project +++ b/libs/project @@ -87,13 +87,11 @@ project_action() { printf '%s\n' "Project ${project} ${action} (with ${arguments:-no argument})" >&2 - "${action}" "$@" - - if [[ "$?" -ne 0 ]]; then + if "${action}" "$@"; then + printf '\n%s\n' "Project ${project} ${action} (with ${arguments:-no argument}) completed" >&2 + else printf '\n%s\n' "Project ${project} ${action} (with ${arguments:-no argument}) failed" >&2 return 1 - else - printf '\n%s\n' "Project ${project} ${action} (with ${arguments:-no argument}) completed" >&2 fi ) } @@ -195,9 +193,9 @@ project_action_arguments_recursive() { local argument local ifs_save - action_helper_arguments="$(project_action_helper 'arguments' "${project}" "$@")" + action_helper_arguments="$(project_action_helper 'arguments' "${project}" "$@" || true)" - if [[ "$?" -ne 0 ]] || [[ -z "${action_helper_arguments}" ]]; then + if [[ -z "${action_helper_arguments}" ]]; then project_action "${action}" "${project}" "$@" else # This it to allow space characters in arguments. -- cgit v1.2.3-70-g09d2