You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/08/13 02:37:32 UTC
js commit: CB-7219 made sure compute commit id is run from cordova-js
repo. Set cwd to cordova-js
Repository: cordova-js
Updated Branches:
refs/heads/cb-7219 416fbd1e2 -> 4257eb2e2
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/4257eb2e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/4257eb2e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/4257eb2e
Branch: refs/heads/cb-7219
Commit: 4257eb2e2a8891a102a4f17200b5fc17023a63ad
Parents: 416fbd1
Author: Steven Gill <st...@gmail.com>
Authored: Tue Aug 12 17:37:29 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Tue Aug 12 17:37:29 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/4257eb2e/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('???');
}