forked from Lookyloo/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs_build.sh
executable file
·23 lines (22 loc) · 1006 Bytes
/
docs_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
cd "${0%/*}" # cd to the folder with script
antora #Verify Antora is installed
RESULT=($?)
if [ $RESULT -eq 127 ]; then #if Antora is not found in $PATH (probably not installed)
echo -e '>> \e[31mFAIL\e[0m Antora not found in \$PATH, Install Antora from https://docs.antora.org/antora/2.3/install/install-antora/'
exit 1
elif [ -f local-site.yml ]; then
rm -rf docs/ #remove the existing docs. Just in case there are docs that should not be there.
echo -e '>> \e[34mINFO\e[0m Building docs with Antora'
if [ "${1}" = "--prod" ]
then
antora --fetch prod-site.yml # build documentation with antora
else
antora --fetch local-site.yml # build documentation with antora
fi
echo -e '>> \e[92mDONE\e[0m Review the generated documentation in index.html, commit the changes and submit a pull request to Lookyloo docs.'
else
echo -e '>> \e[31mFAIL\e[0m local-site.yml not found in the path of the docs_build.sh. Terminating.'
exit 1
fi
exit 0