Skip to content

Commit b26f5fb

Browse files
Mic92mergify[bot]
authored andcommitted
make sure flakeAttr is always defined
1 parent c6ff714 commit b26f5fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/nixos-anywhere.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -euo pipefail
33

44
here=$(dirname "${BASH_SOURCE[0]}")
55
flake=""
6+
flakeAttr=""
67
kexecUrl=""
78
kexecExtraFlags=""
89
enableDebug=""
@@ -246,7 +247,7 @@ parseArgs() {
246247
flake="${BASH_REMATCH[1]}"
247248
flakeAttr="${BASH_REMATCH[2]}"
248249
fi
249-
if [[ -z ${flakeAttr-} ]]; then
250+
if [[ -z ${flakeAttr} ]]; then
250251
echo "Please specify the name of the NixOS configuration to be installed, as a URI fragment in the flake-uri." >&2
251252
echo 'For example, to use the output nixosConfigurations.foo from the flake.nix, append "#foo" to the flake-uri.' >&2
252253
exit 1
@@ -278,7 +279,7 @@ nixBuild() {
278279
}
279280

280281
runVmTest() {
281-
if [[ -z ${flakeAttr-} ]]; then
282+
if [[ -z ${flakeAttr} ]]; then
282283
echo "--vm-test is not supported with --store-paths" >&2
283284
echo "Please use --flake instead or build config.system.build.installTest of your nixos configuration manually" >&2
284285
exit 1

0 commit comments

Comments
 (0)