mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
✨ add build/serve docs commands to manage script
This commit is contained in:
parent
3e06feb224
commit
e388bc5030
2 changed files with 57 additions and 0 deletions
|
|
@ -159,6 +159,8 @@ default_help() {
|
|||
echo -e " ${BWhite}codespell${RST} ${BCyan}Run codespell check for the repository${RST}"
|
||||
echo -e " ${BWhite}run${RST} ${BCyan}Run a poetry command in the repository environment${RST}"
|
||||
echo -e " ${BWhite}run-tests${RST} ${BCyan}Run ayon-core tests${RST}"
|
||||
echo -e " ${BWhite}build-docs${RST} ${BCyan}Build documentation${RST}"
|
||||
echo -e " ${BWhite}serve-docs${RST} ${BCyan}Local serve documentation${RST}"
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
|
@ -189,6 +191,20 @@ run_tests () {
|
|||
"$POETRY_HOME/bin/poetry" run pytest ./tests
|
||||
}
|
||||
|
||||
build_docs () {
|
||||
echo -e "${BIGreen}>>>${RST} Cleaning cache files ..."
|
||||
clean_pyc
|
||||
echo -e "${BIGreen}>>>${RST} Building docs..."
|
||||
"$POETRY_HOME/bin/poetry" run mkdocs build
|
||||
}
|
||||
|
||||
serve_docs () {
|
||||
echo -e "${BIGreen}>>>${RST} Cleaning cache files ..."
|
||||
clean_pyc
|
||||
echo -e "${BIGreen}>>>${RST} Building docs..."
|
||||
"$POETRY_HOME/bin/poetry" run mkdocs serve
|
||||
}
|
||||
|
||||
main () {
|
||||
detect_python || return 1
|
||||
|
||||
|
|
@ -229,6 +245,14 @@ main () {
|
|||
run_tests "$@" || return_code=$?
|
||||
exit $return_code
|
||||
;;
|
||||
"builddocs")
|
||||
build_docs "$@" || return_code=$?
|
||||
exit $return_code
|
||||
;;
|
||||
"servedocs")
|
||||
serve_docs "$@" || return_code=$?
|
||||
exit $return_code
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$function_name" != "" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue