diff options
author | Victor Engmark <vengmark@linz.govt.nz> | 2021-11-26 09:36:42 +1300 |
---|---|---|
committer | Victor Engmark <vengmark@linz.govt.nz> | 2021-11-26 10:51:12 +1300 |
commit | 40d1c87bea38b3937fd4837cbb93fed7be4ffd1d (patch) | |
tree | 3864037b19c118d9852c315b3bbed894025ed4b7 | |
parent | 6d53055cb742e2b04511382f9cdbf9e41ec41f14 (diff) |
lib/tests: Quote variable references
-rwxr-xr-x | lib/tests/sources.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/tests/sources.sh b/lib/tests/sources.sh index e148d023c854..68d21d2aa6d3 100755 --- a/lib/tests/sources.sh +++ b/lib/tests/sources.sh @@ -11,7 +11,7 @@ die() { if test -n "${TEST_LIB:-}"; then NIX_PATH=nixpkgs="$(dirname "$TEST_LIB")" else - NIX_PATH=nixpkgs="$(cd $(dirname ${BASH_SOURCE[0]})/../..; pwd)" + NIX_PATH=nixpkgs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.."; pwd)" fi export NIX_PATH @@ -20,7 +20,7 @@ clean_up() { rm -rf "$work" } trap clean_up EXIT -cd $work +cd "$work" touch {README.md,module.o,foo.bar} @@ -30,7 +30,7 @@ touch {README.md,module.o,foo.bar} dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${ cleanSource ./. }")')" -(cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF +(cd "$dir"; find) | sort -f | diff -U10 - <(cat <<EOF . ./foo.bar ./README.md @@ -41,7 +41,7 @@ EOF dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${ cleanSourceWith { src = '"$work"'; filter = path: type: ! hasSuffix ".bar" path; } }")')" -(cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF +(cd "$dir"; find) | sort -f | diff -U10 - <(cat <<EOF . ./module.o ./README.md @@ -51,7 +51,7 @@ EOF dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${ cleanSourceWith { src = cleanSource '"$work"'; filter = path: type: ! hasSuffix ".bar" path; } }")')" -(cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF +(cd "$dir"; find) | sort -f | diff -U10 - <(cat <<EOF . ./README.md EOF |