cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drk...@apache.org
Subject git commit: CB-4976 dont use cache for local directory
Date Tue, 07 Jan 2014 15:02:44 GMT
Updated Branches:
  refs/heads/master b6d58da7c -> 2ebd0cc8b


CB-4976 dont use cache for local directory


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

Branch: refs/heads/master
Commit: 2ebd0cc8bf057ca142a38022b0d4b7b6fb5b5656
Parents: b6d58da
Author: David Kemp <drkemp@chromium.org>
Authored: Tue Jan 7 09:59:38 2014 -0500
Committer: David Kemp <drkemp@chromium.org>
Committed: Tue Jan 7 09:59:38 2014 -0500

----------------------------------------------------------------------
 src/lazy_load.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2ebd0cc8/src/lazy_load.js
----------------------------------------------------------------------
diff --git a/src/lazy_load.js b/src/lazy_load.js
index 9a36413..cb0ca41 100644
--- a/src/lazy_load.js
+++ b/src/lazy_load.js
@@ -49,9 +49,14 @@ module.exports = {
 
         var lib_dir = platforms[platform] && platforms[platform].subdirectory &&
platform !== "blackberry10" ? path.join(download_dir, platforms[platform].subdirectory) :
download_dir;
 
-        if (fs.existsSync(download_dir)) {
+        // For remote resources and archives this will download and/or unpack and cache them
in the .cordova dir.
+        // In the event that the custom url is a local dir the cache is not used and we must
not return here. The later logic will set things appropriately.
+        var uri = URL.parse(url);
+        if (uri.protocol && uri.protocol[1] != ':') { // second part of conditional
is for awesome windows support. fuuu windows
+          if (fs.existsSync(download_dir)) {
             events.emit('verbose', id + ' library for "' + platform + '" already exists.
No need to download. Continuing.');
             return Q(lib_dir);
+          }
         }
         try {
             // readlinkSync throws if download_dir points to a non-existent file.


Mime
View raw message