]> gitweb.factorcode.org Git - factor.git/commitdiff
build.sh: Use the TRAVIS_CI variable if it's provided.
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 9 Dec 2017 09:22:13 +0000 (09:22 +0000)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 9 Dec 2017 09:26:29 +0000 (09:26 +0000)
Travisci appears to work in a detached head, but commands like ``git symbolic-ref --short HEAD`` return ``HEAD`` instead of ``master`` in detached head states. At least if we're in travisci this should work.

https://stackoverflow.com/questions/6245570/how-to-get-the-current-branch-name-in-git

build.sh

index aef1d9d8570eff76a3b471fff94f574e955c0c38..9e4398d085e8ea3347defb121523c16e294b765d 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -557,7 +557,11 @@ current_git_branch() {
 }
 
 find_branch() {
-    CURRENT_BRANCH=$(current_git_branch)
+    if [ -z ${TRAVIS_BRANCH} ]; then
+        CURRENT_BRANCH=$(current_git_branch)
+    else
+        CURRENT_BRANCH=${TRAVIS_BRANCH}
+    fi
 }
 
 checksum_url() {