From 16e70997a8af42f62b6e00cce5776b00f93fb583 Mon Sep 17 00:00:00 2001 From: Brad Jensen Date: Wed, 24 Jul 2019 09:30:24 -0700 Subject: [PATCH] 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. --- .../development/lisp-modules/clwrapper/cl-wrapper.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh index 3b35d7ba5a9..9836bbe5642 100755 --- a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh +++ b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh @@ -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