You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/11/11 17:04:34 UTC
spec commit: CB-8003: Print a useful error message when tools repos
aren't on a named branch, instead of dying.
Repository: cordova-mobile-spec
Updated Branches:
refs/heads/master 605d369c7 -> 1c983ea78
CB-8003: Print a useful error message when tools repos aren't on a named branch, instead of dying.
Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/1c983ea7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/1c983ea7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/1c983ea7
Branch: refs/heads/master
Commit: 1c983ea784b34260daf66b85eef492e118659304
Parents: 605d369
Author: Ian Clelland <ic...@chromium.org>
Authored: Tue Nov 11 11:02:38 2014 -0500
Committer: Ian Clelland <ic...@chromium.org>
Committed: Tue Nov 11 11:04:11 2014 -0500
----------------------------------------------------------------------
createmobilespec/createmobilespec.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/1c983ea7/createmobilespec/createmobilespec.js
----------------------------------------------------------------------
diff --git a/createmobilespec/createmobilespec.js b/createmobilespec/createmobilespec.js
index 123d30e..15ab18f 100755
--- a/createmobilespec/createmobilespec.js
+++ b/createmobilespec/createmobilespec.js
@@ -255,12 +255,18 @@ function cdOutOf() {
}
function getBranchName(moduleName) {
+ var isConfigFatal = shelljs.config.fatal;
+ shelljs.config.fatal = false;
cdInto(moduleName);
// output should look like: refs/head/master
var gitOutput = shelljs.exec("git symbolic-ref HEAD").output;
+ shelljs.config.fatal = isConfigFatal;
var match = /refs\/heads\/(.*)/.exec(gitOutput);
if (!match) {
- throw new Error('Could not parse branch name from: ' + gitOutput);
+ if (gitOutput.indexOf("is not a symbolic ref") > -1) {
+ throw new Error(moduleName + ' is not on a named git branch.');
+ }
+ throw new Error('Could not parse branch name from: ' + gitOutput + '(in module ' + moduleName + ')');
}
cdOutOf();
return match[1];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org