-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
36 lines (27 loc) · 1.47 KB
/
update.sh
File metadata and controls
36 lines (27 loc) · 1.47 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
#!/bin/bash
# ┌────────────────────────────────────────────────────────────┐
# │ EnumerablePrinter Update Script │
# │ │
# │ Usage: │
# │ ./update.sh "Fix bug" │
# │ │
# │ Args: │
# │ $1 - Commit message (default: "Update EnumerablePrinter") │
# └────────────────────────────────────────────────────────────┘
MESSAGE="${1:-Update EnumerablePrinter}"
log() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1"
}
log "🔍 Running build and test checks..."
dotnet build --nologo --verbosity quiet || { echo "❌ Build failed."; exit 1; }
dotnet test --no-build --nologo --verbosity quiet || { echo "❌ Tests failed."; exit 1; }
log "✅ Checks passed."
log "📦 Staging changes..."
git add .
log "📝 Committing: '$MESSAGE'"
git commit -m "$MESSAGE"
log "🔄 Rebasing from origin/main..."
git pull --rebase origin main
log "🚀 Pushing to origin/main..."
git push origin main
log "✅ Update complete (no version bump, no tag, no deploy)."