1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

shellcheck fix: tests/functional/flakes/show.sh

This commit is contained in:
Farid Zakaria 2025-09-29 09:16:29 -07:00
parent cb22518754
commit f596c9b8c3
2 changed files with 7 additions and 3 deletions

View file

@ -106,7 +106,6 @@
enable = true; enable = true;
excludes = [ excludes = [
# We haven't linted these files yet # We haven't linted these files yet
''^tests/functional/flakes/show\.sh$''
''^tests/functional/formatter\.sh$'' ''^tests/functional/formatter\.sh$''
''^tests/functional/formatter\.simple\.sh$'' ''^tests/functional/formatter\.simple\.sh$''
''^tests/functional/gc-auto\.sh$'' ''^tests/functional/gc-auto\.sh$''

View file

@ -12,6 +12,7 @@ pushd "$flakeDir"
# By default: Only show the packages content for the current system and no # By default: Only show the packages content for the current system and no
# legacyPackages at all # legacyPackages at all
nix flake show --json > show-output.json nix flake show --json > show-output.json
# shellcheck disable=SC2016
nix eval --impure --expr ' nix eval --impure --expr '
let show_output = builtins.fromJSON (builtins.readFile ./show-output.json); let show_output = builtins.fromJSON (builtins.readFile ./show-output.json);
in in
@ -23,6 +24,7 @@ true
# With `--all-systems`, show the packages for all systems # With `--all-systems`, show the packages for all systems
nix flake show --json --all-systems > show-output.json nix flake show --json --all-systems > show-output.json
# shellcheck disable=SC2016
nix eval --impure --expr ' nix eval --impure --expr '
let show_output = builtins.fromJSON (builtins.readFile ./show-output.json); let show_output = builtins.fromJSON (builtins.readFile ./show-output.json);
in in
@ -33,6 +35,7 @@ true
# With `--legacy`, show the legacy packages # With `--legacy`, show the legacy packages
nix flake show --json --legacy > show-output.json nix flake show --json --legacy > show-output.json
# shellcheck disable=SC2016
nix eval --impure --expr ' nix eval --impure --expr '
let show_output = builtins.fromJSON (builtins.readFile ./show-output.json); let show_output = builtins.fromJSON (builtins.readFile ./show-output.json);
in in
@ -80,6 +83,7 @@ cat >flake.nix <<EOF
} }
EOF EOF
nix flake show --json --legacy --all-systems > show-output.json nix flake show --json --legacy --all-systems > show-output.json
# shellcheck disable=SC2016
nix eval --impure --expr ' nix eval --impure --expr '
let show_output = builtins.fromJSON (builtins.readFile ./show-output.json); let show_output = builtins.fromJSON (builtins.readFile ./show-output.json);
in in
@ -91,11 +95,12 @@ true
# Test that nix flake show doesn't fail if one of the outputs contains # Test that nix flake show doesn't fail if one of the outputs contains
# an IFD # an IFD
popd popd
writeIfdFlake $flakeDir writeIfdFlake "$flakeDir"
pushd $flakeDir pushd "$flakeDir"
nix flake show --json > show-output.json nix flake show --json > show-output.json
# shellcheck disable=SC2016
nix eval --impure --expr ' nix eval --impure --expr '
let show_output = builtins.fromJSON (builtins.readFile ./show-output.json); let show_output = builtins.fromJSON (builtins.readFile ./show-output.json);
in in