1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-22 07:10:09 +01:00

Added custom build.sh

This commit is contained in:
Donald Zou 2024-10-06 17:24:53 +08:00
parent 4e5638df36
commit 79f1c20f8a
2 changed files with 33 additions and 1 deletions

32
src/static/app/build.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# Step 1: Run vite build
echo "Running vite build..."
if vite build; then
echo "Vite build successful."
else
echo "Vite build failed. Exiting."
exit 1
fi
# Step 2: Check for changes and commit
echo "Checking for changes to commit..."
if git diff-index --quiet HEAD --; then
echo "No changes to commit. Skipping commit."
else
if git commit -a; then
echo "Git commit successful."
else
echo "Git commit failed. Exiting."
exit 1
fi
fi
# Step 3: Push changes to remote
echo "Pushing changes to remote..."
if git push; then
echo "Git push successful."
else
echo "Git push failed. Exiting."
exit 1
fi

View File

@ -5,7 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build && git commit -a && git push", "build": "./build.sh",
"build electron": "vite build && vite build --mode electron && cd ../../../../WGDashboard-Desktop && electron-builder --mac --win", "build electron": "vite build && vite build --mode electron && cd ../../../../WGDashboard-Desktop && electron-builder --mac --win",
"preview": "vite preview" "preview": "vite preview"
}, },