[ 
https://issues.apache.org/jira/browse/CB-14243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16567744#comment-16567744
 ] 

ASF GitHub Bot commented on CB-14243:
-------------------------------------

brodybits opened a new pull request #632: [WIP] CB-14243 better save_exact fix 
(TODO needs unit test coverage)
URL: https://github.com/apache/cordova-lib/pull/632
 
 
   <!--
   Please make sure the checklist boxes are all checked before submitting the 
PR. The checklist
   is intended as a quick reference, for complete details please see our 
Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   
   All
   
   ### What does this PR do?
   
   Better fix for save_exact (`--save-exact`) flag issue
   
   XXX NOT TESTED
   
   ### What testing has been done on this change?
   
   XXX TODO
   
   - [ ] add unit test coverage to verify that the issue is fixed correctly and 
remains fixed correctly
   - [ ] verify that `cordova` CLI with `--save-exact` flag works correctly 
with this fix
   - [ ] check that `npm test` succeeds on AppVeyor CI
   - [ ] check that `npm test` succeeds on Travis CI
   
   XXX FUTURE TODO: I suspect that there are some other CLI options not covered 
by the unit test. I think the easiest way to check is to try disabling some 
code and see if the test suite catches the effect.
   
   ### Checklist
   
   - ~~[Reported an issue](http://cordova.apache.org/contribute/issues.html) in 
the JIRA database~~
   - [x] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform 
affected.
   - ~~Added automated test coverage as appropriate for this change.~~

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Cordova-lib 8.0.0 ignores save-exact
> ------------------------------------
>
>                 Key: CB-14243
>                 URL: https://issues.apache.org/jira/browse/CB-14243
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-lib
>    Affects Versions: 8.0.0
>         Environment: cordova (Cordova CLI) : 8.0.0  
> System:
>     Android SDK Tools : 26.1.1
>     ios-deploy        : 1.9.2 
>     ios-sim           : 6.0.0 
>     Node              : v8.11.3
>     npm               : 6.2.0 
>     OS                : macOS High Sierra
>     Xcode             : Xcode 9.4.1 Build version 9F2000 
>  
>  
>            Reporter: Aaron T Maldonado
>            Priority: Minor
>
> When installing plugins with an exact version (no semver prefixes) and 
> save-exact is specified either on the command line or via the global config 
> (e.g. cordova config), cordova-lib 8.0.0 modifies package.json and config.xml 
> with semver prefixes. 
> The problem is that cli.js records the option in an object with a key of 
> "save_exact", but in src/cordova/plugin/add.js of cordova-lib, keys of the 
> propagated options object from cli.js are copied into another fetch options 
> object for the plugman fetch. However, save-exact is copied into the new 
> options object by referencing the key "save-exact" instead of "save_exact", 
> which is how it was initially stored in cli.js. Since the referenced key 
> doesn't exist, save-exact will be undefined (i.e. false) when passed to 
> plugman.fetch and therefore ignored.
> This affects both the "--save-exact" command line flag and the save-exact 
> attribute in the cordova global config.
> The fix is to change "save-exact" to "save_exact" on lines 90 and 125 of 
> src/cordova/plugin/add.js in cordova-lib. When I make these changes locally, 
> save-exact works properly.
> [https://github.com/apache/cordova-lib/blob/b8e2c4ddc119c4c8bbe8c073c51612625e084cab/src/cordova/plugin/add.js]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to