This commit is contained in:
Donald Zou 2024-10-06 23:09:55 +08:00
parent 87696a2e6c
commit 56744cec7b
2 changed files with 9 additions and 12 deletions

View File

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

View File

@ -5,7 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "./build.sh", "buildcommitpush": "./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"
}, },