Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 97c70ad

Browse files
dmiusDmitry
authored andcommitted
Check empty options fixed
1 parent ef78e1e commit 97c70ad

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

nancy_run.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,14 @@ while true; do
241241
DEBUG_TIMEOUT="$2"; shift 2 ;;
242242
--ebs-volume-size )
243243
EBS_VOLUME_SIZE="$2"; shift 2 ;;
244-
-- )
245-
>&2 echo "ERROR: Invalid option '$1'"
246-
exit 1;
247-
break ;;
248244
* )
249-
if [ "${1:0:2}" == "--" ]; then
245+
option=$1
246+
option="${option##*( )}"
247+
option="${option%%*( )}"
248+
if [ "${option:0:2}" == "--" ]; then
250249
>&2 echo "ERROR: Invalid option '$1'. Please double-check options."
251250
exit 1
252-
elif [ "${1:0:2}" != "" ]; then
251+
elif [ "$option" != "" ]; then
253252
>&2 echo "ERROR: \"nancy run\" does not support payload (except \"help\"). Use options, see \"nancy run help\")"
254253
exit 1
255254
fi

0 commit comments

Comments
 (0)