From 4721eb7a3c13baddd2c8bf957f99b98d31dcf7b6 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 2 Jun 2024 21:47:53 +0200 Subject: fix(nix-sync): Don't try to exit in a subshell The `(cmd1 && cmd2)` pattern works, but fails with commands like `exit` as the parentheses start a new subshell, which the `exit` command will then close instead of exiting the main shell. The curly brackets have the intended effect here, as they simply group the commands together. --- system/services/nix-sync/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix index 8de5e3c..efa04a3 100644 --- a/system/services/nix-sync/default.nix +++ b/system/services/nix-sync/default.nix @@ -84,7 +84,7 @@ out_paths=$(mktemp); nix build . --print-out-paths --experimental-features 'nix-command flakes' > "$out_paths"; - [ "$(wc -l < "$out_paths")" -gt 1 ] && (echo "To many out-paths"; exit 1) + [ "$(wc -l < "$out_paths")" -gt 1 ] && { echo "To many out-paths"; exit 1; } out_path="$(cat "$out_paths")"; if [ -d ${esa repo.path} ]; then -- cgit 1.4.1