sebastian-onlea opened a new pull request, #913:
URL: https://github.com/apache/cordova-lib/pull/913

   
   
   ### Platforms affected
   CLI - adding and removing plugins with differing required variables per 
platform (e.g. 
[cordova-plugin-googleplus](https://github.com/TheAnkurPanchani/cordova-plugin-googleplus)
 )
   
   ### Motivation and Context
   resolves apache/cordova-cli#578 :
   `cordova plugin rm plugin-package --variable 
"IOS_ONLY_REQUIRED_VARIABLE=variable-value"` will fail if the project includes 
e.g. both android and ios platforms.
   
   ### Description
   In `removePluginFromPlatform()`, at 
[cordova/plugin/remove.js:105](https://github.com/apache/cordova-lib/blob/7f8b2d011dc05749cf6075fe483b5e1bb08f1a07/src/cordova/plugin/remove.js#L105),
 `opts.cli_variables` is destructively reassigned to the result of 
`mergeVariables()`. As mergeVariables() selects only keys specified for a 
specific platform, this can result in CLI-specified values being lost before 
the platform that requires them is processed.
   
   In the change, instead call `uninstallPlatform()` with a copy of `opts` that 
includes the platform-specific `mergeVariables()` result. 
   
   ### Testing
   - Ran existing tests (`npm run test`)
   - verified the change fixes my local use case by `npm link`ing
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
     > I'm not familiar enough with how to create a reproduction case in the 
test library for this project.
   - [x] Commit is prefixed with `(platform)` if this change only applies to 
one platform (e.g. `(android)`)
   - [x] If this Pull Request resolves an issue, I linked to the issue in the 
text above (and used the correct [keyword to close issues using 
keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [x] I've updated the documentation if necessary
     > No doc update should be required
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to