Skip to content

Commit 46ee8af

Browse files
committed
Flip back to non-bash-array option building for now
I'd like to bring this back at some point because it does make things a lot more complete but I want to get some guidelines for using bash features in place before switching shebangs.
1 parent 959b624 commit 46ee8af

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

share/github-backup-utils/ghe-ssh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ set -e
1010
cd $(dirname "$0")/../..
1111
. share/github-backup-utils/ghe-backup-config
1212

13-
eval opts=($GHE_EXTRA_SSH_OPTS)
13+
opts="$GHE_EXTRA_SSH_OPTS"
1414
while true; do
1515
case "$1" in
1616
-p|-l|-o)
17-
opts=("${opts[@]}" $1 "$2")
17+
opts="$opts $1 $2"
1818
shift 2
1919
;;
2020
--)
@@ -42,12 +42,12 @@ port=$(ssh_port_part "$host")
4242
host=$(ssh_host_part "$host")
4343

4444
# Add port / -p option when non-standard port given.
45-
[ "$port" != "22" ] && opts=(-p $port "${opts[@]}")
45+
[ "$port" != "22" ] && opts="-p $port $opts"
4646

4747
# Add user / -l option
4848
user="${host%@*}"
4949
[ "$user" = "$host" ] && user="admin"
50-
opts=(-l "$user" "${opts[@]}")
50+
opts="-l $user $opts"
5151

5252
# Bail out with error if the simple command form is used with complex commands.
5353
# Complex
@@ -61,4 +61,4 @@ fi
6161
$GHE_VERBOSE_SSH && set -x
6262

6363
# Exec ssh command with modified host / port args and add nice to command.
64-
exec ssh "${opts[@]}" -o BatchMode=yes "$host" -- $GHE_NICE $GHE_IONICE "$@"
64+
exec ssh $opts -o BatchMode=yes "$host" -- $GHE_NICE $GHE_IONICE "$@"

0 commit comments

Comments
 (0)