-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync-push.sh
More file actions
executable file
路53 lines (43 loc) 路 1.22 KB
/
Copy pathsync-push.sh
File metadata and controls
executable file
路53 lines (43 loc) 路 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# ============================================================
# Local Sync & Push - Run this from your Mac
# Pushes all changes to GitHub, which triggers auto-deploy
# ============================================================
cd "$(dirname "$0")"
echo "========================================"
echo " 馃摛 Syncing to GitHub..."
echo "========================================"
# Check for git
if [ ! -d ".git" ]; then
echo "Not a git repo! Initialize first:"
echo " git init"
echo " git remote add origin https://github.com/chu11u/dev-env.git"
exit 1
fi
# Check for changes
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to push."
exit 0
fi
# Show what will be pushed
echo ""
echo "Changes to push:"
git status --short
echo ""
read -p "Push these changes? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Cancelled."
exit 0
fi
# Commit everything
git add -A
git commit -m "Auto-update: $(date +%Y-%m-%d)"
# Push
git push origin main
echo ""
echo "========================================"
echo " 馃殌 Changes pushed! Server will auto-deploy..."
echo "========================================"
echo ""
echo "Check new projects at: https://*.apps.elkayam.me"