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 2014/02/04 04:30:56 UTC
git commit: CB-5947 Throw when trying to create project inside custom
www.
Updated Branches:
refs/heads/master 6d05d94fc -> d55087fd6
CB-5947 Throw when trying to create project inside custom www.
If a custom www dir is provided and is a parent or the same as the project dir,
cordova create fails while trying to create an infinite file hierarchy. Detect
this and exit with an error.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/d55087fd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/d55087fd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/d55087fd
Branch: refs/heads/master
Commit: d55087fd6c41da0db6a6ec097b24077d5f092dd2
Parents: 6d05d94
Author: Mark Koudritsky <ka...@chromium.org>
Authored: Thu Jan 30 14:41:32 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Feb 3 22:30:44 2014 -0500
----------------------------------------------------------------------
src/create.js | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/d55087fd/src/create.js
----------------------------------------------------------------------
diff --git a/src/create.js b/src/create.js
index 75b2621..545c65e 100644
--- a/src/create.js
+++ b/src/create.js
@@ -90,6 +90,13 @@ module.exports = function create (dir, id, name, cfg) {
var www_version = config_json.lib.www.version || 'not_versioned';
var www_id = config_json.lib.www.id || 'dummy_id';
symlink = !!config_json.lib.www.link;
+ if ( www_dir.indexOf(path.resolve(config_json.lib.www.uri)) === 0 ) {
+ throw new CordovaError(
+ 'Project must not be created inside the www assets dir.' +
+ '\n project dir:\t' + dir +
+ '\n www assets dir:\t' + config_json.lib.www.uri
+ );
+ }
if(symlink) {
p = Q(config_json.lib.www.uri);
events.emit('verbose', 'Symlinking custom www assets into "' + www_dir + '"');