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-8551) Setup fetching from npm as fallback
Date Wed, 04 Mar 2015 01:58:04 GMT

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

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

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

    https://github.com/apache/cordova-lib/pull/175#discussion_r25746864
  
    --- Diff: cordova-lib/src/plugman/registry/registry.js ---
    @@ -218,10 +205,18 @@ module.exports = {
     
     /**
      * @method initSettings
    + * @param {Boolean} using npm registry
      * @return {Promise.<Object>} Promised settings.
      */
    -function initSettings() {
    +function initSettings(npm) {
         var settings = module.exports.settings;
    +    var registryURL = 'http://registry.cordova.io';
    +
    +    //if npm is true, use npm registry
    +    if(npm) {
    +        registryURL = 'http://registry.npmjs.org';
    +    }
    +
    --- End diff --
    
    Ok, fair enough - I get some people don't like `?:`. The usual alternative is:
    
        var registryURL;
        if (npm) {
            registryURL = 'http://registry.npmjs.org';
        } else {
             registryURL = 'http://registry.cordova.io';
        }
    
    I know this is slightly more verbose, but I think it is cleaner code than assigning something,
then immediately assigning something else if a condition is true. That said, it's only a minor
nit so I won't complain very loudly if you leave it as is :).


> Setup fetching from npm as fallback
> -----------------------------------
>
>                 Key: CB-8551
>                 URL: https://issues.apache.org/jira/browse/CB-8551
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib
>            Reporter: Steve Gill
>            Assignee: Steve Gill
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message