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 Mon, 27 Mar 2017 17:28:42 GMT

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

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_r108229542
  
    --- Diff: cordova-lib/src/cordova/restore-util.js ---
    @@ -63,7 +64,27 @@ function installPlatformsFromConfigXML(platforms, opts) {
                 // Combining arrays and checking duplicates.
                 comboArray = pkgJsonPlatforms.slice();
             }
    +
             engines = cfg.getEngines(projectHome);
    +
    +        if(fs.existsSync(pkgJsonPath)) {
    +            pkgJson = require(pkgJsonPath);
    +
    +        // If package.json doesn't exist, auto-create one.
    +        } else if (engines.length > 0 && !fs.existsSync(pkgJsonPath)) {
    --- End diff --
    
    Hmm taking that check out causes test 016 to fail 
    ```Expected Error: Cannot find module '/private/var/folders/13/dkz30nws1dv3dzlh6dvthwzm0000gn/T/e2e-test/platform_test_pkgjson/project/package.json'
to be undefined.```


> 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