[
https://issues.apache.org/jira/browse/CB-13293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16286396#comment-16286396
]
ASF GitHub Bot commented on CB-13293:
-------------------------------------
stevengill 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_r156162358
##########
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:
So what do we return if `platformAlreadyAdded` is true? I think we need to
return something to make sure we get to line 333.
In line 333, what is `libDir` if it does fetch?
----------------------------------------------------------------
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]