Explorar el Código

deploy_ghpages log and exit if no GH_TOKEN

David Bernard hace 9 años
padre
commit
fbb20e541b
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      deploy_ghpages.sh

+ 4 - 1
deploy_ghpages.sh

@@ -12,12 +12,15 @@ if [ "$TRAVIS_BRANCH" != "master" ] ; then
   exit 0
 fi
 
+if [ "$GH_TOKEN" == "" ] ; then
+  echo "GH_TOKEN is not defined"
+  exit 1
+fi
 
 rev=$(git rev-parse --short HEAD)
 repo=$(git config --local --get-all remote.origin.url | awk -F'[:/]' 'NF && NF-1 {print ($(NF-1)"/"$NF)}')
 
 echo -e "Starting to update gh-pages of ${repo} at ${rev}\n"
-
 # on Travis, can't optimize by cloning itself and define remote as upstream
 # travis> "attempt to fetch/clone from a shallow repository"
 # So need to do a full clone