You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/07/16 22:15:47 UTC

git commit: [CB-4207] Support for custom lib in windows.

Updated Branches:
  refs/heads/master 7702f71d7 -> 9fae7ead6


[CB-4207] Support for custom lib in windows.


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/9fae7ead
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/9fae7ead
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/9fae7ead

Branch: refs/heads/master
Commit: 9fae7ead64ef085afca1903c063892b86ca607af
Parents: 7702f71
Author: Fil Maj <ma...@gmail.com>
Authored: Tue Jul 16 13:15:43 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Tue Jul 16 13:15:43 2013 -0700

----------------------------------------------------------------------
 src/config.js    | 1 +
 src/lazy_load.js | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/9fae7ead/src/config.js
----------------------------------------------------------------------
diff --git a/src/config.js b/src/config.js
index ca41ee6..f6c7b88 100644
--- a/src/config.js
+++ b/src/config.js
@@ -59,6 +59,7 @@ module.exports.has_custom_path = function(project_root, platform) {
     if (json.lib && json.lib[platform]) {
         var uri = url.parse(json.lib[platform].uri);
         if (!(uri.protocol)) return uri.path;
+        else if (uri.protocol && uri.protocol[1] ==':') return uri.href;
     }
     return false;
 };

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/9fae7ead/src/lazy_load.js
----------------------------------------------------------------------
diff --git a/src/lazy_load.js b/src/lazy_load.js
index 3ca566e..8566514 100644
--- a/src/lazy_load.js
+++ b/src/lazy_load.js
@@ -63,7 +63,7 @@ module.exports = {
             version:version
         }, function() {
             var uri = URL.parse(url);
-            if (uri.protocol) {
+            if (uri.protocol && uri.protocol[1] != ':') { // second part of conditional is for awesome windows support. fuuu windows
                 shell.mkdir('-p', download_dir);
                 events.emit('log', 'Requesting ' + url + '...');
                 var size = 0;
@@ -95,7 +95,7 @@ module.exports = {
             } else {
                 // local path
                 // symlink instead of copying
-                fs.symlinkSync(uri.path, download_dir, 'dir');
+                fs.symlinkSync((uri.protocol && uri.protocol[1] == ':' ? uri.href : uri.path), download_dir, 'dir');
                 hooker.fire('after_library_download', {
                     platform:platform,
                     url:url,