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 918591141B for ; Fri, 29 Aug 2014 23:58:59 +0000 (UTC) Received: (qmail 8377 invoked by uid 500); 29 Aug 2014 23:58:59 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 8271 invoked by uid 500); 29 Aug 2014 23:58:59 -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 8021 invoked by uid 99); 29 Aug 2014 23:58:59 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Aug 2014 23:58:59 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 28B0B9A9EDF; Fri, 29 Aug 2014 23:58:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Fri, 29 Aug 2014 23:59:03 -0000 Message-Id: <609aac1f4d66417c8bb590bb9e12905d@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [5/7] js commit: CB-7219 made sure compute commit id is run from cordova-js repo. Set cwd to cordova-js CB-7219 made sure compute commit id is run from cordova-js repo. Set cwd to cordova-js Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/6e7d6458 Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/6e7d6458 Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/6e7d6458 Branch: refs/heads/cb-7219 Commit: 6e7d6458852630c595a2e73c8e99da9b18fe8794 Parents: d1e0a91 Author: Steven Gill Authored: Tue Aug 12 17:37:29 2014 -0700 Committer: Steven Gill Committed: Mon Aug 18 17:09:09 2014 -0700 ---------------------------------------------------------------------- tasks/lib/compute-commit-id.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6e7d6458/tasks/lib/compute-commit-id.js ---------------------------------------------------------------------- diff --git a/tasks/lib/compute-commit-id.js b/tasks/lib/compute-commit-id.js index 794ebd9..a4c4765 100644 --- a/tasks/lib/compute-commit-id.js +++ b/tasks/lib/compute-commit-id.js @@ -27,11 +27,14 @@ module.exports = function computeCommitId(callback, cachedGitVersion) { callback(cachedGitVersion); return; } - - if (fs.existsSync('.git')) { + + var cordovaJSDir = path.join(__dirname, '../../'); + + //make sure .git directory exists in cordova.js repo + if (fs.existsSync(path.join(__dirname, '../../.git'))) { var gitPath = 'git'; var args = 'rev-list HEAD --max-count=1'; - childProcess.exec(gitPath + ' ' + args, function(err, stdout, stderr) { + childProcess.exec(gitPath + ' ' + args, {cwd:cordovaJSDir}, function(err, stdout, stderr) { var isWindows = process.platform.slice(0, 3) == 'win'; if (err && isWindows) { gitPath = '"' + path.join(process.env['ProgramFiles'], 'Git', 'bin', 'git.exe') + '"'; @@ -51,6 +54,7 @@ module.exports = function computeCommitId(callback, cachedGitVersion) { } }); } else { + console.log('no git'); done('???'); }