added check for git command availability. Updated my contact email in the contributors list.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/commit/878a655e Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/878a655e Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/878a655e Branch: refs/heads/cordova-client Commit: 878a655ef69185af93c4ac5a078bb08f295e034f Parents: 6c3f342 Author: Mike Reinstein <reinstein.m...@gmail.com> Authored: Mon Sep 24 09:02:03 2012 -0400 Committer: Fil Maj <maj....@gmail.com> Committed: Tue Sep 25 17:36:03 2012 -0700 ---------------------------------------------------------------------- package.json | 2 +- src/util.js | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/878a655e/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index 16afbf5..997fde8 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "contributors": [ {"name": "Brian LeRoux","email": "b...@brian.io"}, {"name": "Fil Maj", "email": "fil...@apache.org"}, - {"name": "Mike Reinstein", "email":""}, + {"name": "Mike Reinstein", "email":"reinstein.m...@gmail.com"}, {"name": "Darry Pogue", "email":"dar...@dpogue.ca"} ], "license": "Apache version 2.0" http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/878a655e/src/util.js ---------------------------------------------------------------------- diff --git a/src/util.js b/src/util.js index e824527..f56eb24 100644 --- a/src/util.js +++ b/src/util.js @@ -37,14 +37,23 @@ module.exports = { * @throws Javascript Error on failure */ getPlatformLib: function getPlatformLib(target) { + // TODO: process.exit(1) is a pretty terrible pattern because it kills + // excecution immediately and prevents cleanup routines. However, + // I don't want to just spew a stack trace to the user either. + + // verify platform is supported if (!repos[target]) { - // TODO: this is really a pretty terrible pattern because it kills - // excecution immediately and prevents cleanup routines. However, - // I don't want to just spew a stack trace to the user either. console.error('platform "' + target + '" not found.'); process.exit(1); } - // specify which project tag to check out. minimum tag is 2.1.0 + + // verify that git command line is available + if (!shell.which('git')) { + console.error('"git" command not found.'); + process.exit(1); + } + + // specify which project tag to check out. minimum tag is 2.1.0rc1 var cordova_lib_tag = '2.1.0'; if (target == 'android') { // FIXME: android hack. 2.1.0 tag messed up the create script