-
Notifications
You must be signed in to change notification settings - Fork 104
/
update_docs
executable file
·45 lines (39 loc) · 1.29 KB
/
update_docs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
cd doc
printf "\n\nUpdating API documentation and testing html compilation\n\n"
sleep 1
make clean
failed=0
make html || failed=1
git add api
git add pypeit_par.rst
cd ../
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
nwarnings=$(wc -l "doc/sphinx_warnings.out" | awk '{print $1}')
if [ ${failed} -ne 0 ]; then
printf "\n\n${RED}============================${NC}\n"
printf "${RED}Sphinx build scripts FAILED!${NC}\n"
printf "${RED}============================${NC}\n\n"
elif [ ${nwarnings} -ne 0 ]; then
printf "\n\n${RED}====================${NC}\n"
printf "${RED}Sphinx build FAILED: ${nwarnings} warnings found.${NC}\n"
printf "${RED}====================${NC}\n\n"
else
printf "\n\n${GREEN}========================${NC}\n"
printf "${GREEN}Sphinx build successful.${NC}\n"
printf "${GREEN}========================${NC}\n\n"
fi
printf "Check the modified files with:\n"
printf " git status\n\n"
printf "Fix any errors/warnings in:\n"
printf " doc/sphinx_warnings.out\n\n"
printf "Make sure to add any new api files:\n"
printf " git add doc/api\n\n"
printf "Add any additional changes with:\n"
printf " git add -u\n\n"
printf "Commit and push the changes with: \n"
printf " git commit -m 'updated docs'\n"
printf " git push\n\n"
exit 0