Skip to content

Commit

Permalink
Merge pull request #12415 from silvanshade/fix-shellcheck-lints
Browse files Browse the repository at this point in the history
Fix shellcheck lints
  • Loading branch information
edolstra authored Feb 5, 2025
2 parents d2425c5 + f90ba3a commit 1a8dfc0
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/functional/flakes/symlink-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ requireGit

create_flake() {
local flakeDir="$1"
createGitRepo $flakeDir
cat > $flakeDir/flake.nix <<EOF
createGitRepo "$flakeDir"
cat > "$flakeDir/flake.nix" <<EOF
{
outputs = { self }: { x = 2; };
}
EOF
git -C $flakeDir add flake.nix
git -C $flakeDir commit -m Initial
git -C "$flakeDir" add flake.nix
git -C "$flakeDir" commit -m Initial
}

test_symlink_points_to_flake() {
Expand All @@ -34,15 +34,15 @@ test_symlink_points_to_flake_in_subdir

test_symlink_points_to_dir_in_repo() {
local repoDir="$TEST_ROOT/flake1"
createGitRepo $repoDir
createGitRepo "$repoDir"
mkdir -p "$repoDir/subdir"
cat > $repoDir/subdir/flake.nix <<EOF
cat > "$repoDir/subdir/flake.nix" <<EOF
{
outputs = { self }: { x = 2; };
}
EOF
git -C $repoDir add subdir/flake.nix
git -C $repoDir commit -m Initial
git -C "$repoDir" add subdir/flake.nix
git -C "$repoDir" commit -m Initial
ln -sn "$TEST_ROOT/flake1/subdir" "$TEST_ROOT/flake1_sym"
[[ $(nix eval "$TEST_ROOT/flake1_sym#x") = 2 ]]
rm -rf "$TEST_ROOT/flake1" "$TEST_ROOT/flake1_sym"
Expand All @@ -51,22 +51,22 @@ test_symlink_points_to_dir_in_repo

test_symlink_from_repo_to_another() {
local repoDir="$TEST_ROOT/repo1"
createGitRepo $repoDir
echo "Hello" > $repoDir/file
mkdir $repoDir/subdir
cat > $repoDir/subdir/flake.nix <<EOF
createGitRepo "$repoDir"
echo "Hello" > "$repoDir/file"
mkdir "$repoDir/subdir"
cat > "$repoDir/subdir/flake.nix" <<EOF
{
outputs = { self }: { x = builtins.readFile ../file; };
}
EOF
git -C $repoDir add subdir/flake.nix file
git -C $repoDir commit -m Initial
git -C "$repoDir" add subdir/flake.nix file
git -C "$repoDir" commit -m Initial
[[ $(nix eval "$TEST_ROOT/repo1/subdir#x") == \"Hello\\n\" ]]

local repo2Dir="$TEST_ROOT/repo2"
createGitRepo $repo2Dir
createGitRepo "$repo2Dir"
ln -sn "$repoDir/subdir" "$repo2Dir/flake1_sym"
echo "World" > $repo2Dir/file
echo "World" > "$repo2Dir/file"
git -C "$repo2Dir" add flake1_sym file
git -C "$repo2Dir" commit -m Initial
[[ $(nix eval "$repo2Dir/flake1_sym#x") == \"Hello\\n\" ]]
Expand Down

0 comments on commit 1a8dfc0

Please sign in to comment.