forked from pypeit/PypeIt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_docs
More file actions
executable file
·51 lines (45 loc) · 1.56 KB
/
Copy pathupdate_docs
File metadata and controls
executable file
·51 lines (45 loc) · 1.56 KB
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
45
46
47
48
49
50
#!/bin/bash
RED='\033[0;31m'
YELLOW='\033[0;33m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
cd doc
printf "\n\nUpdating API documentation and testing html compilation\n\n"
sleep 1
RAWDIR="${PYPEIT_DEV}/RAW_DATA"
failed=0
if [ -n "$PYPEIT_DEV" ] && [ -e "$RAWDIR" ]; then
(make clean ; make html) || failed=1
else
printf "${YELLOW}WARNING: Cannot access dev-suite RAW_DATA dir. Building docs without automated example docs.${NC}\n"
make htmlnoex || failed=1
fi
git add api
git add pypeit_par.rst
cd ../
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