Skip to content

Commit

Permalink
make sure sshConnection is always set
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 16, 2024
1 parent 98b56b4 commit 3187e9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ if [ -t 0 ]; then # stdin is a tty, we allow interactive input to ssh i.e. passw
else
sshTtyParam="-T"
fi
sshConnection=
postKexecSshPort=22
buildOnRemote=n
envPassword=n
Expand Down Expand Up @@ -223,7 +224,7 @@ parseArgs() {
vmTest=y
;;
*)
if [[ -z ${sshConnection-} ]]; then
if [[ -z ${sshConnection} ]]; then
sshConnection="$1"
else
showUsage
Expand All @@ -238,7 +239,7 @@ parseArgs() {
nixOptions+=("-L")
fi

if [[ $vmTest == "n" ]] && [[ -z ${sshConnection-} ]]; then
if [[ $vmTest == "n" ]] && [[ -z ${sshConnection} ]]; then
abort "ssh-host must be set"
fi

Expand Down

0 comments on commit 3187e9e

Please sign in to comment.