diff --git a/src/static/app/build.sh b/src/static/app/build.sh new file mode 100755 index 0000000..171b801 --- /dev/null +++ b/src/static/app/build.sh @@ -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 diff --git a/src/static/app/package.json b/src/static/app/package.json index 1995703..b5e3c4c 100644 --- a/src/static/app/package.json +++ b/src/static/app/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "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", "preview": "vite preview" },