housekeeping: shellcheck for tests/functional/flakes/circular.sh

This commit is contained in:
Cameron Dart 2024-06-04 13:33:12 -07:00 committed by John Ericson
parent ece86b7191
commit 3b853e795b

View File

@ -8,10 +8,10 @@ requireGit
flakeA=$TEST_ROOT/flakeA
flakeB=$TEST_ROOT/flakeB
createGitRepo $flakeA
createGitRepo $flakeB
createGitRepo "$flakeA"
createGitRepo "$flakeB"
cat > $flakeA/flake.nix <<EOF
cat > "$flakeA"/flake.nix <<EOF
{
inputs.b.url = git+file://$flakeB;
inputs.b.inputs.a.follows = "/";
@ -23,9 +23,9 @@ cat > $flakeA/flake.nix <<EOF
}
EOF
git -C $flakeA add flake.nix
git -C "$flakeA" add flake.nix
cat > $flakeB/flake.nix <<EOF
cat > "$flakeB"/flake.nix <<EOF
{
inputs.a.url = git+file://$flakeA;
@ -35,18 +35,18 @@ cat > $flakeB/flake.nix <<EOF
}
EOF
git -C $flakeB add flake.nix
git -C $flakeB commit -a -m 'Foo'
git -C "$flakeB" add flake.nix
git -C "$flakeB" commit -a -m 'Foo'
[[ $(nix eval $flakeA#foo) = 1579 ]]
[[ $(nix eval $flakeA#foo) = 1579 ]]
[[ $(nix eval "$flakeA#foo") = 1579 ]]
[[ $(nix eval "$flakeA#foo") = 1579 ]]
sed -i $flakeB/flake.nix -e 's/456/789/'
git -C $flakeB commit -a -m 'Foo'
sed -i "$flakeB"/flake.nix -e 's/456/789/'
git -C "$flakeB" commit -a -m 'Foo'
nix flake update b --flake $flakeA
[[ $(nix eval $flakeA#foo) = 1912 ]]
nix flake update b --flake "$flakeA"
[[ $(nix eval "$flakeA#foo") = 1912 ]]
# Test list-inputs with circular dependencies
nix flake metadata $flakeA
nix flake metadata "$flakeA"