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-12425) Auto-create a package.json if it doesn't exist yet
Date Fri, 24 Mar 2017 17:16:41 GMT

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

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

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

    https://github.com/apache/cordova-lib/pull/521#discussion_r107954943
  
    --- Diff: cordova-lib/src/cordova/restore-util.js ---
    @@ -114,13 +135,19 @@ function installPlatformsFromConfigXML(platforms, opts) {
                 events.emit('verbose', 'Package.json and config.xml platforms are different.
Updating config.xml with most current list of platforms.');
                 comboArray.forEach(function(item) {
                     var prefixItem = ('cordova-'+item);
    +
                     // Modify package.json if any of these cases are true:
    -                if((pkgJson.dependencies === undefined && Object.keys(mergedPlatformSpecs).length)||
    -                    (pkgJson.dependencies[item] === undefined && mergedPlatformSpecs[item])
||
    -                    (pkgJson.dependencies[prefixItem] === undefined && mergedPlatformSpecs[prefixItem]))
{
    +                if((pkgJson.dependencies === undefined && Object.keys(mergedPlatformSpecs).length)
||
    +                (pkgJson.dependencies && mergedPlatformSpecs && pkgJson.dependencies[item]
=== undefined && mergedPlatformSpecs[item]) || 
    +                (pkgJson.dependencies && mergedPlatformSpecs && pkgJson.dependencies[prefixItem]
=== undefined && mergedPlatformSpecs[prefixItem])) {
                         modifiedPkgJson = true;
                     }
     
    +                // if ((pkgJson.dependencies && mergedPlatformSpecs &&
pkgJson.dependencies[item] === undefined && mergedPlatformSpecs[item]) || 
    --- End diff --
    
    Good catch! thanks! 


> Auto-create a package.json if it doesn't exist yet
> --------------------------------------------------
>
>                 Key: CB-12425
>                 URL: https://issues.apache.org/jira/browse/CB-12425
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaLib
>    Affects Versions: cordova-7
>            Reporter: Audrey So
>            Assignee: Audrey So
>              Labels: cordova-7.0.0
>
> When restoring during cordova prepare, auto-create a package.json if it doesn't exist
yet.



--
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