You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mm...@apache.org on 2014/07/03 16:55:41 UTC
git commit: CB-7070 Don't create hooks/ if it already exists
Repository: cordova-lib
Updated Branches:
refs/heads/master a18029fe8 -> 7fc66be7c
CB-7070 Don't create hooks/ if it already exists
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/7fc66be7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/7fc66be7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/7fc66be7
Branch: refs/heads/master
Commit: 7fc66be7c7cec46b53b77ec7ab2d52044780e0ad
Parents: a18029f
Author: Michal Mocny <mm...@gmail.com>
Authored: Thu Jul 3 10:55:29 2014 -0400
Committer: Michal Mocny <mm...@gmail.com>
Committed: Thu Jul 3 10:55:29 2014 -0400
----------------------------------------------------------------------
cordova-lib/src/cordova/create.js | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/7fc66be7/cordova-lib/src/cordova/create.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/create.js b/cordova-lib/src/cordova/create.js
index 2d2b429..d086fc3 100644
--- a/cordova-lib/src/cordova/create.js
+++ b/cordova-lib/src/cordova/create.js
@@ -213,13 +213,16 @@ function create(dir, id, name, cfg) {
// Create basic project structure.
shell.mkdir(path.join(dir, 'platforms'));
shell.mkdir(path.join(dir, 'plugins'));
- shell.mkdir(path.join(dir, 'hooks'));
- // Add hooks README.md
- shell.cp(path.join(__dirname, '..', '..', 'templates', 'hooks-README.md'), path.join(dir, 'hooks', 'README.md'));
+ // Add template hooks/ for apps that are missing it
+ if (!custom_hooks) {
+ shell.mkdir(path.join(dir, 'hooks'));
+ // Add hooks README.md
+ shell.cp(path.join(__dirname, '..', '..', 'templates', 'hooks-README.md'), path.join(dir, 'hooks', 'README.md'));
+ }
- var configPath = cordova_util.projectConfig(dir);
// Add template config.xml for apps that are missing it
+ var configPath = cordova_util.projectConfig(dir);
if (!fs.existsSync(configPath)) {
var template_config_xml = path.join(__dirname, '..', '..', 'templates', 'config.xml');
shell.cp(template_config_xml, configPath);