examples: enable running outside of working dir

This commit is contained in:
Erik Arvstedt 2020-10-11 20:02:24 +02:00
parent 04075b108c
commit 16b2783ae7
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
3 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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