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

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

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

 ##########
 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)) {
 
 Review comment:
   For instance, if I add the ios platform to my project, `libDir = 
/Users/auso/cordova/tests/project_9/node_modules/cordova-ios`

----------------------------------------------------------------
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:
[email protected]


> 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: [email protected]
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to