cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dase...@apache.org
Subject cordova-lib git commit: CB-9712 CLI 5.3 breaks with node 3.3.3
Date Mon, 12 Oct 2015 10:53:46 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master cc1ab409f -> 1b55e26bc


CB-9712 CLI 5.3 breaks with node 3.3.3

Replaced paths referencing cordova-app-hello-world to take npm@3 plain modules structure into
account (dedup).
This includes a temporary fallback on old method, which is to be discarded when cordova-app-hello-world
is released.


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

Branch: refs/heads/master
Commit: 1b55e26bc5b234aa5c988291eee010607dba7c00
Parents: cc1ab40
Author: daserge <v-seshak@microsoft.com>
Authored: Tue Oct 6 13:40:45 2015 +0300
Committer: daserge <v-seshak@microsoft.com>
Committed: Fri Oct 9 22:14:41 2015 +0300

----------------------------------------------------------------------
 cordova-lib/src/cordova/create.js | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1b55e26b/cordova-lib/src/cordova/create.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/create.js b/cordova-lib/src/cordova/create.js
index dd55d0c..1eded17 100644
--- a/cordova-lib/src/cordova/create.js
+++ b/cordova-lib/src/cordova/create.js
@@ -113,7 +113,13 @@ function create(dir, optionalId, optionalName, cfg) {
         cfg.lib.www.url = cfg.lib.www.url || cfg.lib.www.uri;
 
         if (!cfg.lib.www.url) {
-            cfg.lib.www.url = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world');
+            try {
+                cfg.lib.www.url = require('cordova-app-hello-world').dirname;
+            } catch (e) {
+                // Falling back on npm@2 path hierarchy
+                // TODO: Remove fallback after cordova-app-hello-world release
+                cfg.lib.www.url = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world');
+            }
         }
 
         // TODO (kamrik): extend lazy_load for retrieval without caching to allow net urls
for --src.
@@ -192,7 +198,13 @@ function create(dir, optionalId, optionalName, cfg) {
             paths.configXml = path.join(paths.root, 'config.xml');
             paths.configXmlLinkable = true;
         } else {
-            paths.configXml = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world',
'config.xml');
+            try {
+                paths.configXml = path.join(require('cordova-app-hello-world').dirname, 'config.xml');
+            } catch (e) {
+                // Falling back on npm@2 path hierarchy
+                // TODO: Remove fallback after cordova-app-hello-world release
+                paths.configXml = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world',
'config.xml');
+            }
         }
         if (fs.existsSync(path.join(paths.root, 'merges'))) {
             paths.merges = path.join(paths.root, 'merges');
@@ -203,7 +215,13 @@ function create(dir, optionalId, optionalName, cfg) {
             paths.hooks = path.join(paths.root, 'hooks');
             paths.hooksLinkable = true;
         } else {
-            paths.hooks = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world',
'hooks');
+            try {
+                paths.hooks = path.join(require('cordova-app-hello-world').dirname, 'hooks');
+            } catch (e) {
+                // Falling back on npm@2 path hierarchy
+                // TODO: Remove fallback after cordova-app-hello-world release
+                paths.hooks = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world',
'hooks');
+            }
         }
 
         var dirAlreadyExisted = fs.existsSync(dir);


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


Mime
View raw message