瀏覽代碼

deploy_ghpages log and exit if no GH_TOKEN

David Bernard 9 年之前
父節點
當前提交
fbb20e541b
共有 1 個文件被更改,包括 4 次插入1 次删除
  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