cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-12021) --fetch should use dependency version saved in package.json before default cordova version when adding/restoring
Date Sat, 18 Feb 2017 01:15:44 GMT

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

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

Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/518#discussion_r101877994
  
    --- Diff: cordova-lib/src/cordova/plugin.js ---
    @@ -414,13 +414,15 @@ function determinePluginTarget(projectRoot, cfg, target, fetchOptions)
{
         // it does not satisfy.
         if(parsedSpec.version) {
             if(pkgJson && pkgJson.dependencies && pkgJson.dependencies[parsedSpec.package])
{
    -            var noSymbolVersion;
    +            var noSymbolVersion = parsedSpec.version;
                 if (parsedSpec.version.charAt(0) === '^' || parsedSpec.version.charAt(0)
=== '~') {
                     noSymbolVersion = parsedSpec.version.slice(1);
                 }
    -            if (!semver.satisfies(noSymbolVersion, pkgJson.dependencies[parsedSpec.package]))
{
    +            if (pkgJson.dependencies[parsedSpec.package] === parsedSpec.version) {
    --- End diff --
    
    I think we still want to do the semver check too. First start with outer if that checks
if `parsedSpec.version` is a directory or url,  if it is, do this check  to see if `pkgJson.dependencies[parsedSpec.package]
!== parsedSpec.version`. If that is true, then you want to update package.json (assuming fetchOpts.save
=== true)
    
    On that outer if that checks if it is a dir or url, add a else if where you check for
semver.satisfies


> --fetch should use dependency version saved in package.json before default cordova version
when adding/restoring
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CB-12021
>                 URL: https://issues.apache.org/jira/browse/CB-12021
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-fetch, CordovaLib
>            Reporter: Steve Gill
>            Assignee: Audrey So
>              Labels: cordova-7.0.0
>             Fix For: 7.0.0
>
>
> cordova platform add android --save --fetch should use the version of cordova-android
already saved in package.json instead of the version from platformsConfig.json



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message