Skip to content

Commit 564132b

Browse files
committed
fixes ghe-restore arg parsing when the host is specified first
1 parent 471f0b8 commit 564132b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bin/ghe-restore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ while true; do
6262
exit 1
6363
;;
6464
*)
65-
break
65+
if [ -n "$1" ]; then
66+
GHE_HOSTNAME="$1"
67+
shift
68+
else
69+
break
70+
fi
6671
;;
6772
esac
6873
done
@@ -81,7 +86,7 @@ cleanup () {
8186
. "$( dirname "${BASH_SOURCE[0]}" )/../share/github-backup-utils/ghe-backup-config"
8287

8388
# Grab the host arg
84-
GHE_HOSTNAME="${1:-$GHE_RESTORE_HOST}"
89+
GHE_HOSTNAME="${GHE_HOSTNAME:-$GHE_RESTORE_HOST}"
8590

8691
# Hostname without any port suffix
8792
hostname=$(echo "$GHE_HOSTNAME" | cut -f 1 -d :)

0 commit comments

Comments
 (0)