-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Parse options correctly #248
Conversation
Ping @vladimir-kotikov |
c1651fd
to
cefa8b7
Compare
Ping @infil00p for review |
@Mitko-Kerezov, sorry for delay. The second fix LGTM. Also in order to proceed with this PR could you please submit an Apache CLA and file a JIRA for these bugs as described here: https://github.com/apache/cordova-android/blob/master/CONTRIBUTING.md |
This looks like a great fix to merge. @Mitko-Kerezov Did you get a chance to file the ICLA? |
@nikhilkh I've already filed the ICLA some time in 2015 and have already contributed to cordova. (Can't find the email though but I have merged pull requests) @vladimir-kotikov regarding your comment, I don't believe |
@Mitko-Kerezov, my bad, i missed you name in CLA list Regarding the
I'd say it tells "do not consider the options behind me, just pass them to underlying script" (see, for example, istanbul docs and There is two possible ways to run build: It is also still necessary for compatibility reasons (IMO, changing the way how CLI arguments are treated is a breaking change). |
parseOpts function referenced this.root but the this object is not the new Api as expected. This leads to an exception upon calling path.relative(this.root, ...).
Nopt parses all options regardless of what is passed as "knownOpts". This leaves the remain property an emtpy array. This ultimately leads to a bug in the parseOpts function where the options undergo a second parsing from nopt. The end result is - this options are not respected at all.
cefa8b7
to
bcc3fe4
Compare
@vladimir-kotikov |
Verified and it seems to work fine now with all possible combinations of |
Wohoo! Good to see this is getting committed! |
Nopt parses all options regardless of what is passed as "knownOpts". This leaves the remain property an emtpy array. This ultimately leads to a bug in the parseOpts function where the options undergo a second parsing from nopt. The end result is - this options are not respected at all.. This closes apache#248
Fix 1
Options have already passed through
nopt
module in the build file. Nopt successfully parses all options which results inargv.remain
being an empty array.This ultimately leads to a bug in the
parseOpts
function where the options undergo a second parsing from nopt.The end result is - this options are not respected at all.
Fix 2
parseOpts function referenced
this.root
but thethis
object is not thenew Api
as expected. This leads to an exception upon callingpath.relative(this.root, ...)
.