Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ADCA711899 for ; Thu, 3 Jul 2014 14:55:41 +0000 (UTC) Received: (qmail 5348 invoked by uid 500); 3 Jul 2014 14:55:41 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 5320 invoked by uid 500); 3 Jul 2014 14:55:41 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 5311 invoked by uid 99); 3 Jul 2014 14:55:41 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2014 14:55:41 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 3F6F1995CE8; Thu, 3 Jul 2014 14:55:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mmocny@apache.org To: commits@cordova.apache.org Message-Id: <7a78252c5bcd41a28777f3ead70990f2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: CB-7070 Don't create hooks/ if it already exists Date: Thu, 3 Jul 2014 14:55:41 +0000 (UTC) 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 Authored: Thu Jul 3 10:55:29 2014 -0400 Committer: Michal Mocny 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);