mirror of
https://mau.dev/andreijiroh-dev/website.git
synced 2025-06-07 21:19:32 +00:00
fix(scripts): 🔨 patch scripts for environment detection stuff [skip ci]
Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
parent
7e3ba7df54
commit
81902a0b3c
3 changed files with 84 additions and 2 deletions
29
bin/build.sh
Executable file
29
bin/build.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [[ $DEBUG != "" ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
_root_directory_git=$(git rev-parse --show-toplevel)
|
||||
TARGET_DIR=${TARGET_DIR:-"$PWD/public"}
|
||||
|
||||
## source vars from .env first ##
|
||||
export "$(xargs < "$_root_directory_git/.env")"
|
||||
|
||||
warn() {
|
||||
echo "warning: $*"
|
||||
}
|
||||
|
||||
error() {
|
||||
echo "error: $*"
|
||||
}
|
||||
|
||||
if [[ ! -d .venv ]]; then
|
||||
python3 -m venv .venv
|
||||
"$_root_directory_git/.venv/bin/pip3" install -r requirements.txt --upgrade
|
||||
fi
|
||||
|
||||
"$_root_directory_git/.venv/bin/mkdocs" build \
|
||||
-d "$TARGET_DIR" \
|
||||
--use-directory-urls \
|
||||
--verbose
|
Loading…
Add table
Add a link
Reference in a new issue