You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/12/13 14:18:26 UTC

git commit: CB-5347 Handle dangling platform symlink in cordova platform add

Updated Branches:
  refs/heads/master f338c0fc6 -> a3d7f0ed3


CB-5347 Handle dangling platform symlink in cordova platform add


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

Branch: refs/heads/master
Commit: a3d7f0ed35bca915a9c322d1542001ba0db378d1
Parents: f338c0f
Author: Josh Soref <js...@blackberry.com>
Authored: Mon Nov 11 16:40:28 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Dec 13 08:18:11 2013 -0500

----------------------------------------------------------------------
 src/lazy_load.js | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/a3d7f0ed/src/lazy_load.js
----------------------------------------------------------------------
diff --git a/src/lazy_load.js b/src/lazy_load.js
index dcaa126..5072819 100644
--- a/src/lazy_load.js
+++ b/src/lazy_load.js
@@ -53,6 +53,11 @@ module.exports = {
             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.
+            var dangling = fs.readlinkSync(download_dir);
+            return Q.reject(download_dir + " points to non-existent or unreadable location: " + dangling);
+        } catch (e) {}
         events.emit('log', 'Downloading ' + id + ' library for ' + platform + '...');
         return hooker.fire('before_library_download', {
             platform:platform,