cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject git commit: CB-7070 Don't create hooks/ if it already exists
Date Thu, 03 Jul 2014 14:55:41 GMT
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 <mmocny@gmail.com>
Authored: Thu Jul 3 10:55:29 2014 -0400
Committer: Michal Mocny <mmocny@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);


Mime
View raw message