-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·57 lines (47 loc) · 1.36 KB
/
update.sh
File metadata and controls
executable file
·57 lines (47 loc) · 1.36 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
54
55
56
57
#!/bin/bash
# VibeTrees Update Script
# Updates to the latest version from GitHub
set -e # Exit on error
echo "🔄 Updating VibeTrees..."
echo ""
# Get the script directory (where VibeTrees is installed)
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"
echo "📁 Location: $SCRIPT_DIR"
echo ""
# Check for uncommitted changes
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
echo "⚠️ Warning: You have uncommitted changes"
echo ""
git status --short
echo ""
read -p "Continue anyway? (y/N) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "❌ Update cancelled"
exit 1
fi
fi
# Pull latest changes
echo "📥 Pulling latest changes from GitHub..."
git pull origin main
# Check if package.json changed
if git diff HEAD@{1} --name-only | grep -q "package.json"; then
echo ""
echo "📦 package.json changed, updating dependencies..."
npm install
fi
echo ""
echo "✅ VibeTrees updated successfully!"
echo ""
echo "🚀 Next time you run 'vibe', you'll have the latest version"
echo ""
# Show what changed
COMMITS=$(git rev-list --count HEAD@{1}..HEAD 2>/dev/null || echo "0")
if [ "$COMMITS" != "0" ]; then
echo "📝 New commits:"
git log --oneline HEAD@{1}..HEAD | head -10
if [ "$COMMITS" -gt 10 ]; then
echo " ... and $((COMMITS - 10)) more"
fi
fi