Use if instead of && for deciding whether to run a command

The only difference between these forms is the return value when
"$NIX_LISP_SKIP_CODE" is the empty string.  In the original
formulation, the script would return a false exit status.  In the new
formulation, it will return a true exit status.

Its useful to be able to source cl-wrapper.sh (to get the variables it
establishes), and its a bit annoying that sourcing it with
NIX_LISP_SKIP_CODE=1 results in a false exit status.
This commit is contained in:
Brad Jensen 2019-07-24 09:30:24 -07:00
parent fa7bd53d0d
commit 16e70997a8

View file

@ -121,8 +121,10 @@ nix_lisp_build_system(){
eval "$NIX_LISP_PRELAUNCH_HOOK"
[ -z "$NIX_LISP_SKIP_CODE" ] && "$NIX_LISP_COMMAND" $NIX_LISP_EARLY_OPTIONS \
$NIX_LISP_EXEC_CODE "${NIX_LISP_ASDF_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.$NIX_LISP_FASL_TYPE\")"}" \
$NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \
${NIX_LISP_FINAL_PARAMETERS[*]:+"${NIX_LISP_FINAL_PARAMETERS[@]}"} \
"$@"
if [ -z "$NIX_LISP_SKIP_CODE" ]; then
"$NIX_LISP_COMMAND" $NIX_LISP_EARLY_OPTIONS \
$NIX_LISP_EXEC_CODE "${NIX_LISP_ASDF_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.$NIX_LISP_FASL_TYPE\")"}" \
$NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \
${NIX_LISP_FINAL_PARAMETERS[*]:+"${NIX_LISP_FINAL_PARAMETERS[@]}"} \
"$@"
fi