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 2014/06/09 21:07:12 UTC
[1/3] git commit: Properly resolve relative paths given on
command-line
Repository: cordova-coho
Updated Branches:
refs/heads/master 41fc084fe -> a2512a280
Properly resolve relative paths given on command-line
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/a2512a28
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/a2512a28
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/a2512a28
Branch: refs/heads/master
Commit: a2512a280bcb879104f56039e94f4a230ae4f366
Parents: ce0f6d2
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Jun 9 15:06:32 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Jun 9 15:07:00 2014 -0400
----------------------------------------------------------------------
src/apputil.js | 9 +++++++--
src/create-verify-archive.js | 16 +++++++++++-----
2 files changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/a2512a28/src/apputil.js
----------------------------------------------------------------------
diff --git a/src/apputil.js b/src/apputil.js
index 2f72890..c729d81 100644
--- a/src/apputil.js
+++ b/src/apputil.js
@@ -21,13 +21,18 @@ var path = require('path');
var chalk = require('chalk');
var origWorkingDir = process.cwd();
+var baseWorkingDir = origWorkingDir;
+
+exports.resolveUserSpecifiedPath = function(p) {
+ return path.resolve(origWorkingDir, p);
+};
exports.initWorkingDir = function(chdir) {
var curDir = path.resolve(origWorkingDir);
var newDir = chdir ? path.resolve(path.join(__dirname), '..', '..') : curDir;
if (curDir != newDir) {
process.chdir(newDir);
- origWorkingDir = newDir;
+ baseWorkingDir = newDir;
}
console.log('Running from ' + newDir);
}
@@ -41,7 +46,7 @@ exports.print = function() {
var newArgs = Array.prototype.slice.call(arguments);
// Prefix any prints() to distinguish them from command output.
if (newArgs.length > 1 || newArgs[0]) {
- var curDir = path.relative(origWorkingDir, process.cwd());
+ var curDir = path.relative(baseWorkingDir, process.cwd());
curDir = curDir ? curDir + '/' : './';
var banner = ' =';
var PREFIX_LEN = 30;
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/a2512a28/src/create-verify-archive.js
----------------------------------------------------------------------
diff --git a/src/create-verify-archive.js b/src/create-verify-archive.js
index e8fd5f1..602132d 100644
--- a/src/create-verify-archive.js
+++ b/src/create-verify-archive.js
@@ -19,6 +19,7 @@ under the License.
var optimist = require('optimist');
var shelljs = require('shelljs');
+var chalk = require('chalk');
var fs = require('fs');
var path = require('path');
var apputil = require('./apputil');
@@ -61,19 +62,23 @@ exports.createCommand = function*(argv) {
apputil.fatal('gpg command not found on your PATH. Refer to https://wiki.apache.org/cordova/SetUpGpg');
}
- var outDir = argv.dest;
+ var outDir = apputil.resolveUserSpecifiedPath(argv.dest);
shelljs.mkdir('-p', outDir);
var absOutDir = path.resolve(outDir);
yield repoutil.forEachRepo(repos, function*(repo) {
var tag = argv.tag || (yield gitutil.findMostRecentTag());
print('Creating archive of ' + repo.repoName + '@' + tag);
+ yield gitutil.gitCheckout('master');
- if(repo.id==='plugman'|| repo.id==='cli'){
+ if (repo.id==='plugman'|| repo.id==='cli') {
+ if (yield gitutil.pendingChangesExist()) {
+ apputil.fatal('Aborting because pending changes exist in ' + repo.repoName);
+ }
var tgzname = yield executil.execHelper(executil.ARGS('npm pack'), true);
var outPath = path.join(absOutDir, 'cordova-' + tgzname);
shelljs.mv(tgzname, outPath);
- }else{
+ } else {
var outPath = path.join(absOutDir, repo.repoName + '-' + tag + '.zip');
yield executil.execHelper(executil.ARGS('git archive --format zip --prefix ' + repo.repoName + '/ -o ', outPath, tag));
}
@@ -108,7 +113,7 @@ exports.verifyCommand = function*(argv) {
}
for (var i = 0; i < zipPaths.length; ++i) {
- var zipPath = zipPaths[i];
+ var zipPath = apputil.resolveUserSpecifiedPath(zipPaths[i]);
yield executil.execHelper(executil.ARGS('gpg --verify', zipPath + '.asc', zipPath));
var md5 = yield computeHash(zipPath, 'MD5');
if (extractHashFromOutput(fs.readFileSync(zipPath + '.md5', 'utf8')) !== md5) {
@@ -118,8 +123,9 @@ exports.verifyCommand = function*(argv) {
if (extractHashFromOutput(fs.readFileSync(zipPath + '.sha', 'utf8')) !== sha) {
apputil.fatal('SHA512 does not match.');
}
- print(zipPath + ' signature and hashes verified.');
+ print(zipPath + chalk.green(' signature and hashes verified.'));
}
+ print(chalk.green('Verified ' + zipPaths.length + ' signatures and hashes.'));
}
function *computeHash(path, algo) {
[2/3] git commit: Find tags relative to master branch (instead of
HEAD)
Posted by ag...@apache.org.
Find tags relative to master branch (instead of HEAD)
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/ce0f6d20
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/ce0f6d20
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/ce0f6d20
Branch: refs/heads/master
Commit: ce0f6d20cf2f491fbcc99b495ee00318b08f33fe
Parents: 9550eaf
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Jun 9 15:06:18 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Jun 9 15:07:00 2014 -0400
----------------------------------------------------------------------
src/gitutil.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/ce0f6d20/src/gitutil.js
----------------------------------------------------------------------
diff --git a/src/gitutil.js b/src/gitutil.js
index 0f9af86..91e4b86 100644
--- a/src/gitutil.js
+++ b/src/gitutil.js
@@ -22,7 +22,7 @@ var executil = require('./executil');
var gitutil = exports;
exports.findMostRecentTag = function() {
- return executil.execHelper(executil.ARGS('git describe --tags --abbrev=0 HEAD'), true);
+ return executil.execHelper(executil.ARGS('git describe --tags --abbrev=0 master'), true);
}
exports.tagExists = function*(tagName) {
[3/3] git commit: Remove unused requires
Posted by ag...@apache.org.
Remove unused requires
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/9550eaf1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/9550eaf1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/9550eaf1
Branch: refs/heads/master
Commit: 9550eaf10e758b0a80a64268b6c58759014476f5
Parents: 41fc084
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Jun 9 15:06:04 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Jun 9 15:07:00 2014 -0400
----------------------------------------------------------------------
src/verify-tags.js | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/9550eaf1/src/verify-tags.js
----------------------------------------------------------------------
diff --git a/src/verify-tags.js b/src/verify-tags.js
index e65c5c6..776d97c 100644
--- a/src/verify-tags.js
+++ b/src/verify-tags.js
@@ -18,11 +18,7 @@ under the License.
*/
var optimist = require('optimist');
-var shelljs = require('shelljs');
-var fs = require('fs');
-var path = require('path');
var apputil = require('./apputil');
-var executil = require('./executil');
var flagutil = require('./flagutil');
var gitutil = require('./gitutil');
var repoutil = require('./repoutil');