File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 3131fi
3232
3333# set USER
34- USER =${TRAVIS_REPO_SLUG%/* }
34+ GH_USER =${TRAVIS_REPO_SLUG%/* }
3535
3636# configure your name and email if you have not done so
3737git config --global user.email
" [email protected] " 3838git config --global user.name " TRAVIS-DOC-BUILD"
3939
4040# Don't deploy if documentation git repo does not exist
41- if ! ( git ls-remote -h
[email protected] :
${USER} /pecan-documentation
> /dev/null
2>&1 )
; then 42- echo " Can't find a repository at https://github.com/${USER} /pecan-documentation"
41+ GH_STATUS=$( curl -s -w %{http_code} -I https://github.com/${GH_USER} /pecan-documentation -o /dev/null)
42+ if [[ $GH_STATUS != 200 ]]; then
43+ echo " Can't find a repository at https://github.com/${GH_USER} /pecan-documentation"
4344 echo " Will not render Book."
4445 exit 0
4546fi
4647
47- git clone https://${GITHUB_PAT} @github.com/${USER } /pecan-documentation.git book_hosted
48+ git clone https://${GITHUB_PAT} @github.com/${GH_USER } /pecan-documentation.git book_hosted
4849cd book_hosted
4950
5051# # Check if branch named directory exists
Original file line number Diff line number Diff line change 1212# Clone book_hosted directory if it doesn't exist
1313if [ ! -d book_hosted ]; then
1414 # Set GitHub user
15- USER =${TRAVIS_REPO_SLUG%/* }
15+ GH_USER =${TRAVIS_REPO_SLUG%/* }
1616
1717 # Don't deploy if documentation git repo does not exist
18- if ! ( git ls-remote -h
[email protected] :
${USER} /pecan-documentation
> /dev/null
2>&1 )
; then 19- echo " Can't find a repository at https://github.com/${USER} /pecan-documentation"
18+ GH_STATUS=$( curl -s -w %{http_code} -I https://github.com/${GH_USER} /pecan-documentation -o /dev/null)
19+ if [[ $GH_STATUS != 200 ]]; then
20+ echo " Can't find a repository at https://github.com/${GH_USER} /pecan-documentation"
2021 echo " Will not render tutorials."
2122 exit 0
2223 fi
@@ -25,7 +26,7 @@ if [ ! -d book_hosted ]; then
2526 git config --global user.email
" [email protected] " 2627 git config --global user.name " TRAVIS-DOC-BUILD"
2728
28- git clone https://${GITHUB_PAT} @github.com/${USER } /pecan-documentation.git book_hosted
29+ git clone https://${GITHUB_PAT} @github.com/${GH_USER } /pecan-documentation.git book_hosted
2930fi
3031
3132# Create tutorial directory
You can’t perform that action at this time.
0 commit comments