You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/12/07 19:31:00 UTC

[jira] [Commented] (CB-13293) already fetched platforms shouldn't call fetch code

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

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

purplecabbage commented on a change in pull request #605: CB-13293 : if fetch has been called already, no need to fetch again
URL: https://github.com/apache/cordova-lib/pull/605#discussion_r155618105
 
 

 ##########
 File path: src/cordova/platform/addHelper.js
 ##########
 @@ -292,7 +292,9 @@ function getVersionFromConfigFile (platform, cfg) {
 function downloadPlatform (projectRoot, platform, version, opts) {
     var target = version ? (platform + '@' + version) : platform;
     return Q().then(function () {
-        if (opts.fetch) {
+        var platformPath = path.join(projectRoot, 'platforms', platform);
+        var platformAlreadyAdded = fs.existsSync(platformPath);
+        if ((opts.fetch) && (!platformAlreadyAdded || platformAlreadyAdded === undefined || platformAlreadyAdded === null)) {
 
 Review comment:
   If platformAlreadyAdded is undefined or null the first condition will be truthy so there is no point in adding the additional tests.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


> already fetched platforms shouldn't call fetch code
> ---------------------------------------------------
>
>                 Key: CB-13293
>                 URL: https://issues.apache.org/jira/browse/CB-13293
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-lib
>            Reporter: Steve Gill
>            Assignee: Audrey So
>              Labels: tools-next
>             Fix For: cordova@7.1.0
>
>
> adding a platform that has already been added/fetched will still call cordova-fetch before realizing the platform is already installed. Need to check if platform is added first. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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