You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/09/17 16:11:28 UTC
[2/2] js commit: Change build stamp again by having it use only
VERSION file on master branch
Change build stamp again by having it use only VERSION file on master branch
This will have it show "3.2.0-dev-HASH" on master even though there is
no "3.2.0-dev" git tag.
(cherry picked from commit 8e5a2e730da70b8a8f597c7fba9bc328e0d89546)
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/7e798f2a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/7e798f2a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/7e798f2a
Branch: refs/heads/3.1.x
Commit: 7e798f2a8bf1caf2b3bb9f86accf7c673f732799
Parents: 968f501
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Sep 17 10:09:33 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Sep 17 10:10:46 2013 -0400
----------------------------------------------------------------------
build/packager.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7e798f2a/build/packager.js
----------------------------------------------------------------------
diff --git a/build/packager.js b/build/packager.js
index 6c325c4..39bfcce 100644
--- a/build/packager.js
+++ b/build/packager.js
@@ -30,9 +30,10 @@ packager.computeCommitId = function(callback) {
callback(cachedGitVersion);
return;
}
- if (fs.existsSync('.git')) {
+ var versionFileId = fs.readFileSync('VERSION', { encoding: 'utf8' }).trim();
+ if (/-dev$/.test(versionFileId) && fs.existsSync('.git')) {
var gitPath = 'git';
- var args = 'describe --tags';
+ var args = 'rev-list HEAD --max-count=1 --abbrev-commit';
childProcess.exec(gitPath + ' ' + args, function(err, stdout, stderr) {
var isWindows = process.platform.slice(0, 3) == 'win';
if (err && isWindows) {
@@ -41,13 +42,13 @@ packager.computeCommitId = function(callback) {
if (err) {
error(err);
} else {
- done(stdout);
+ done(versionFileId + '-' + stdout);
}
});
} else if (err) {
error(err);
} else {
- done(stdout);
+ done(versionFileId + '-' + stdout);
}
});
} else {