Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo paddle/scripts/travis/before_install.linux.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then paddle/scripts/travis/before_install.osx.sh; fi
- if [[ "$JOB" == "PRE_COMMIT" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
- pip install wheel protobuf sphinx recommonmark virtualenv numpy sphinx_rtd_theme pre-commit
- pip install wheel protobuf sphinx recommonmark virtualenv numpy sphinx_rtd_theme pre-commit requests==2.9.2 LinkChecker
script:
- paddle/scripts/travis/main.sh
notifications:
Expand Down
14 changes: 12 additions & 2 deletions paddle/scripts/travis/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ source ./common.sh
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=ON
make paddle_docs paddle_docs_cn

# check websites for broken links
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把下面的代码,改成

linkchecker doc/cn/html/index.html
linkchecker doc/en/html/index.html

本来如果开启set -e就是在对返回值做判断,不需要在if判断一下了。

同时,就两个目录,写个循环的行数都大于直接写两个的行数了。没啥必要写循环。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

set +e
for i in cn en; do
linkchecker doc/$i/html/index.html
if [ $? -ne 0 ]; then
exit 1
fi
done
set -e

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set -e

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# Parse Github URL
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//[email protected]:}
Expand Down Expand Up @@ -35,8 +45,8 @@ git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH

# remove old docs. mv new docs.
rm -rf doc doc_cn
mv ../doc_cn/html doc_cn
mv ../doc/html doc
mv ../doc/cn/html doc_cn
mv ../doc/en/html doc

# Check is there anything changed.
set +e
Expand Down