cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject cordova-lib git commit: CB-8239 Fix `cordova platform add PATH` when PATH is relative and CWD != project root
Date Mon, 09 Feb 2015 20:41:00 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master b7eabab1d -> 36194fa6e


CB-8239 Fix `cordova platform add PATH` when PATH is relative and CWD != project root


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/36194fa6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/36194fa6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/36194fa6

Branch: refs/heads/master
Commit: 36194fa6e7e0480bc4b8e390cc9b742116dbe420
Parents: b7eabab
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Mon Feb 9 15:40:30 2015 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Mon Feb 9 15:40:30 2015 -0500

----------------------------------------------------------------------
 cordova-lib/src/cordova/platform.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/36194fa6/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js b/cordova-lib/src/cordova/platform.js
index 76ca330..214dd61 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -101,8 +101,11 @@ function addHelper(cmd, hooksRunner, projectRoot, targets, opts) {
                     events.emit('verbose', 'No version supplied. Retrieving version from
config.xml...');
                     version = getVersionFromConfigFile(platform, cfg);
                 }
-                if (version && isDirectory(version)) {
-                    return getPlatformDetailsFromDir(version, platform);
+                if (version) {
+                    var maybeDir = cordova_util.fixRelativePath(version);
+                    if (isDirectory(maybeDir)) {
+                        return getPlatformDetailsFromDir(maybeDir, platform);
+                    }
                 }
                 return downloadPlatform(projectRoot, platform, version, opts);
             }).then(function(platDetails) {


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


Mime
View raw message