diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-07-17 15:24:21 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-07-17 16:52:08 -0400 |
commit | 3adb05d41dd7346c452359a694b629ce37c17272 (patch) | |
tree | ef2a8c7ea85b958e83cb55cea66cee4452c84dcc /libs | |
parent | c2d613cdb887f64856540837a61d69d7c68119cc (diff) | |
download | librebootfr-3adb05d41dd7346c452359a694b629ce37c17272.tar.gz librebootfr-3adb05d41dd7346c452359a694b629ce37c17272.zip |
Avoid checking previous exit codes indirectly
Diffstat (limited to 'libs')
-rwxr-xr-x | libs/project | 12 |
1 files changed, 5 insertions, 7 deletions
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. |