From 6c993b1c0cb85566f5d0e90676aa7f5001d96c50 Mon Sep 17 00:00:00 2001 From: Andrew Dunkman Date: Fri, 27 Mar 2015 22:28:42 -0500 Subject: [PATCH] Allow detached head when parsing master ref. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we have checked out a commit instead of a branch name, git is in what’s known as “detached head” state. This is what Travis does all the time. This means that we were never considered to be on the branch “master”, and therefore were never publishing bower-chosen. We can tweak the git command we’re calling to support either checked out branch names or detached heads — as long as we’re at the commit for a commit that is the head of master, we’re peachykeen! --- bower-publish.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower-publish.sh b/bower-publish.sh index add8b8c98ff..13be70d6827 100755 --- a/bower-publish.sh +++ b/bower-publish.sh @@ -1,6 +1,6 @@ #!/bin/sh -CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD` +CURRENT_BRANCH=`git name-rev --name-only HEAD` if [ $CURRENT_BRANCH != 'master' ] ; then echo "Build not on master. Skipped bower-chosen release"