This repository was archived by the owner on Mar 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·129 lines (108 loc) · 3.57 KB
/
update.sh
File metadata and controls
executable file
·129 lines (108 loc) · 3.57 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
echo "==================================="
echo "Sober Profile Manager - Updater"
echo "==================================="
echo ""
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR" || exit 1
if ! command -v git &> /dev/null; then
echo "Error: git is not installed. Please install git first."
echo " Arch/Manjaro: sudo pacman -S git"
echo " Ubuntu/Debian: sudo apt install git"
echo " Fedora: sudo dnf install git"
exit 1
fi
if [ ! -d .git ]; then
echo "Error: Not a git repository. Cannot update."
echo "Please clone the repository using:"
echo " git clone https://github.com/evanovar/RobloxAccountManagerLinux.git"
exit 1
fi
echo "Fetching latest changes from GitHub..."
git fetch origin
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "Current branch: $CURRENT_BRANCH"
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
if [ "$LOCAL" = "$REMOTE" ]; then
echo ""
echo "✓ You are already up to date!"
exit 0
fi
echo ""
echo "Updates available!"
echo ""
echo "Changes to be pulled:"
git log HEAD..@{u} --oneline --decorate --color
echo ""
read -p "Do you want to update? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo ""
echo "Backing up your data..."
if [ -d "ProfileManagerData" ]; then
BACKUP_DIR="ProfileManagerData_backup_$(date +%Y%m%d_%H%M%S)"
if cp -r ProfileManagerData "$BACKUP_DIR"; then
echo "✓ Backup created: $BACKUP_DIR"
else
echo "✗ Warning: Backup creation failed"
fi
else
echo "⚠ ProfileManagerData directory not found (nothing to back up)"
fi
echo ""
echo "Pulling latest changes..."
if ! git diff-index --quiet HEAD --; then
echo "⚠ Local changes detected. Stashing them temporarily..."
git stash
STASHED=1
else
STASHED=0
fi
git pull origin "$CURRENT_BRANCH"
GIT_PULL_EXIT=$?
if [ $STASHED -eq 1 ]; then
echo "Restoring your local changes..."
git stash pop 2>/dev/null || echo "⚠ Warning: Could not automatically restore changes. Use 'git stash pop' manually."
fi
if [ $GIT_PULL_EXIT -eq 0 ]; then
echo ""
echo "✓ Update successful!"
echo ""
if git diff HEAD@{1} HEAD --name-only 2>/dev/null | grep -q "requirements.txt"; then
echo "Dependencies may have changed. Updating..."
if command -v pip &> /dev/null; then
pip install -r requirements.txt --upgrade 2>&1
echo "✓ Dependencies updated!"
else
echo "⚠ Warning: pip not found. Please manually run:"
echo " pip install -r requirements.txt --upgrade"
fi
fi
echo ""
echo "==================================="
echo "Update complete!"
echo ""
echo "IMPORTANT: Close the app and restart it:"
echo " python main.py"
echo "==================================="
else
echo ""
echo "✗ Update failed (git exit code: $GIT_PULL_EXIT)"
echo "There may be conflicts or connectivity issues."
echo "If you have local changes, try:"
echo " git stash # Save your changes"
echo " git pull # Update"
echo " git stash pop # Restore your changes"
echo ""
echo "Press Enter to continue..."
read
exit 1
fi
else
echo "Update cancelled."
exit 0
fi
echo ""
echo "Press Enter to close this window..."
read