Made a really basic script that runs the vitepress proccess.

This commit is contained in:
yuanhau 2025-05-20 15:31:59 +08:00
parent 7b46cc7e6f
commit 5c64ae08bf
10 changed files with 309 additions and 17 deletions

31
build_docs.sh Executable file
View file

@ -0,0 +1,31 @@
#!/bin/bash
ask_yes_no() {
while true; do
read -p "$1 (y/n): " answer
case ${answer:0:1} in
y|Y ) return 0 ;;
n|N ) return 1 ;;
* ) echo "Please answer yes or no.";;
esac
done
}
if ask_yes_no "Are you ABSOLUTELY in the root dir of the app?"; then
echo "Proceeding with build..."
cd ./docs/
if ask_yes_no "Have you installed vitepress before?"; then
echo "Skipping"
else
echo "Installing vitepress with bun..."
bun add -D vitepress
fi
bunx vitepress build
cd ..
cp -R ./docs/.vitepress/dist/ ./public/docs/
echo "Done :)"
exit 1
else
echo "Please navigate to the root directory and try again."
exit 1
fi