-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(install): Skip the 0th arg as it is the script name #659
Conversation
@@ -24,7 +24,7 @@ SENTRY_EXTRA_REQUIREMENTS='sentry/requirements.txt' | |||
MINIMIZE_DOWNTIME= | |||
|
|||
load_options() { | |||
while [[ -n "$@" ]]; do | |||
while [[ -n "${@:1}" ]]; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${@:1}
is kind of a special case of bash-specific substring expansion ${parameter:offset}
where bash arrays are treated specially, I had to look this up myself. I'd suggest this to make it more readable, your choice though.
while [[ -n "${@:1}" ]]; do | |
shift # throw away $0 | |
while [[ -n "$@" ]]; do |
The problem seems to actually be with It's not a problem with "$@" - bash manual says "$@ Expands to the positional parameters, starting from one." https://www.gnu.org/software/bash/manual/bash.html#index-_0040 - which means getopt shouldn't get the $0, and shouldn't pass it to Edit: fixed in #660. |
Closing in favor of #660 |
Fixes #656.