You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/09/05 20:14:46 UTC

[41/50] git commit: Remove use of path.join for manifest.launch_path

Remove use of path.join for manifest.launch_path

I was having issues on Windows when creating a new FirefoxOS project. A brand new project, when added to the Firefox App Manager, gave an error: "Launch path has to be an absolute path starting with '/': '\index.html'". The issue is the use of path.join to generate manifest.launch_path. On Windows, this uses backslashes, which caused the issue. I have opted to simply use concatenation instead.

I have also fixed an issue where "cordova prepare firefoxos" would fail if there was no <content> tag in the config.xml. If it is not present, we default to index.html.


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

Branch: refs/heads/master
Commit: d406be5ede49a13ce2fddd220fc2ea557a7d093e
Parents: 586d874
Author: Menardi <he...@gearoid.me>
Authored: Fri Aug 22 22:35:13 2014 +0100
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:12:19 2014 -0700

----------------------------------------------------------------------
 cordova-lib/src/cordova/metadata/firefoxos_parser.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d406be5e/cordova-lib/src/cordova/metadata/firefoxos_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/firefoxos_parser.js b/cordova-lib/src/cordova/metadata/firefoxos_parser.js
index e3f4818..b4e435e 100644
--- a/cordova-lib/src/cordova/metadata/firefoxos_parser.js
+++ b/cordova-lib/src/cordova/metadata/firefoxos_parser.js
@@ -49,8 +49,8 @@ module.exports.prototype = {
 
         // overwrite properties existing in config.xml
         var contentNode = config.doc.find('content');
-        var contentSrc = contentNode.attrib['src'];
-        manifest.launch_path = path.join('/', contentSrc) || '/index.html';
+        var contentSrc = contentNode && contentNode.attrib['src'] || 'index.html';
+        manifest.launch_path = '/' + contentSrc;
 
         manifest.installs_allowed_from = manifest.installs_allowed_from || ['*'];
         manifest.version = config.version();