From 16b2783ae79ab0c8f15978e32bddfa3b46a41ff5 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 11 Oct 2020 20:02:24 +0200 Subject: [PATCH] examples: enable running outside of working dir --- examples/deploy-container.sh | 1 + examples/deploy-nixops.sh | 1 + examples/deploy-qemu-vm.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/examples/deploy-container.sh b/examples/deploy-container.sh index f9fc494..5ec5439 100755 --- a/examples/deploy-container.sh +++ b/examples/deploy-container.sh @@ -19,6 +19,7 @@ fi if [[ ! -v IN_NIX_SHELL ]]; then echo "Running script in nix shell env..." + cd "${BASH_SOURCE[0]%/*}" exec nix-shell --run "${BASH_SOURCE[0]}" fi diff --git a/examples/deploy-nixops.sh b/examples/deploy-nixops.sh index 155cc5e..780fc00 100755 --- a/examples/deploy-nixops.sh +++ b/examples/deploy-nixops.sh @@ -10,6 +10,7 @@ set -euo pipefail if [[ ! -v IN_NIX_SHELL ]]; then echo "Running script in nix shell env..." + cd "${BASH_SOURCE[0]%/*}" exec nix-shell --run "${BASH_SOURCE[0]}" fi diff --git a/examples/deploy-qemu-vm.sh b/examples/deploy-qemu-vm.sh index 01ad0df..7545807 100755 --- a/examples/deploy-qemu-vm.sh +++ b/examples/deploy-qemu-vm.sh @@ -13,6 +13,7 @@ set -euo pipefail if [[ ! -v IN_NIX_SHELL ]]; then echo "Running script in nix shell env..." + cd "${BASH_SOURCE[0]%/*}" exec nix-shell --run "${BASH_SOURCE[0]}" fi