Skip to content

Commit 21a2b33

Browse files
committed
check for -h before checking for arg errors
1 parent 30b1428 commit 21a2b33

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

script/autotier-init-dirs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ function join_by { local IFS="$1"; shift; echo "$*"; }
3333

3434
command -v rsync > /dev/null 2>&1 || { echo "rsync must be installed to run this script. Install it and try again."; exit 1; }
3535

36-
if [[ "$#" < "2" ]]; then
37-
echo Must provide at least two tier paths.
38-
usage
39-
exit 1
40-
fi
41-
4236
while getopts "h" opt; do
4337
case $opt in
4438
h)
@@ -54,6 +48,12 @@ while getopts "h" opt; do
5448
esac
5549
done
5650

51+
if [[ "$#" < "2" ]]; then
52+
echo Must provide at least two tier paths.
53+
usage
54+
exit 1
55+
fi
56+
5757
# check that each argument is a valid path
5858
for tier in $@; do
5959
if [ ! -d "$tier" ]; then

0 commit comments

Comments
 (0)