about summary refs log tree commit diff
path: root/pkgs/development/lisp-modules
diff options
context:
space:
mode:
authorBrad Jensen <brad@bradjensen.net>2019-07-24 09:30:24 -0700
committerBrad Jensen <brad@bradjensen.net>2019-07-24 09:35:27 -0700
commit16e70997a8af42f62b6e00cce5776b00f93fb583 (patch)
tree3161474cef2ff8efbf01e0fd3eec058fd933dd91 /pkgs/development/lisp-modules
parentfa7bd53d0d002646870a18e202ac98b3ac0f598c (diff)
downloadnixlib-16e70997a8af42f62b6e00cce5776b00f93fb583.tar
nixlib-16e70997a8af42f62b6e00cce5776b00f93fb583.tar.gz
nixlib-16e70997a8af42f62b6e00cce5776b00f93fb583.tar.bz2
nixlib-16e70997a8af42f62b6e00cce5776b00f93fb583.tar.lz
nixlib-16e70997a8af42f62b6e00cce5776b00f93fb583.tar.xz
nixlib-16e70997a8af42f62b6e00cce5776b00f93fb583.tar.zst
nixlib-16e70997a8af42f62b6e00cce5776b00f93fb583.zip
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.
Diffstat (limited to 'pkgs/development/lisp-modules')
-rwxr-xr-xpkgs/development/lisp-modules/clwrapper/cl-wrapper.sh12
1 files 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 3b35d7ba5a95..9836bbe56428 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