-
Notifications
You must be signed in to change notification settings - Fork 492
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
[BUG] bin doesnt work when incrementing arg with equals sign #431
Closed
gonza7aav opened this issue
Feb 19, 2022
· 3 comments
· Fixed by #449 or #451 · May be fixed by OutSystems/cordova-plugin-add-swift-support#3
Closed
[BUG] bin doesnt work when incrementing arg with equals sign #431
gonza7aav opened this issue
Feb 19, 2022
· 3 comments
· Fixed by #449 or #451 · May be fixed by OutSystems/cordova-plugin-add-swift-support#3
Comments
Good catch! This is a bug:
|
lukekarrys
changed the title
[QUESTION] Why the main function inserts an empty string into argv?
[BUG] bin doesnt work when incrementing arg with equals sign
Apr 9, 2022
An equals sign should be the preferred form with long options; it’d be great to audit all long options for this. |
I believe this is the fix. It should be getting the value before overwriting
|
lukekarrys
added a commit
that referenced
this issue
Apr 10, 2022
lukekarrys
added a commit
that referenced
this issue
Apr 10, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What / Why
Why it unshift an empty string into argv when an argument contains a "="?
Let's suppose
a
contains an "=", thenindexOfEqualSign
won't be -1. Inside the if statement, it overwritesa
with a slice of it (removing whatever is after the "="). After that, it inserts into argv another slice ofa
. But this slice starts atindexOfEqualSign
+ 1 (the part we just remove), so an empty string ("") will be returned by the slice and inserted by the unshift.As I understood, the empty string doesn't affect the execution because it is filtered out at line 92. But, Why it bother to add an "", loop with it, add it to versions to finally remove from versions? I think I am missing something. Can someone explain it to me, please?
The text was updated successfully, but these errors were encountered: