-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
Β·31 lines (26 loc) Β· 1.05 KB
/
Copy pathupdate.sh
File metadata and controls
executable file
Β·31 lines (26 loc) Β· 1.05 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
#!/usr/bin/env bash
set -e
echo "=== π Updating Rix ==="
# 1. Pull the latest source code
echo "π¦ Fetching latest changes from GitHub..."
git pull origin main
# 2. Compile the updated binary
echo "π οΈ Compiling latest release..."
cargo build --release
# 3. Detect existing installation and replace the binary
if [ -f "/usr/local/bin/rix" ]; then
echo "π Detected system-wide installation. Requesting sudo to update binary..."
sudo cp target/release/rix-cli /usr/local/bin/rix
sudo chmod +x /usr/local/bin/rix
echo "β
System-wide Rix updated successfully!"
elif [ -f "$HOME/.local/bin/rix" ]; then
echo "π€ Detected user-space installation. Updating binary..."
cp target/release/rix-cli "$HOME/.local/bin/rix"
chmod +x "$HOME/.local/bin/rix"
echo "β
User-space Rix updated successfully!"
else
echo "π¦ Falling back to Cargo installation..."
cargo install --path rix-cli --force
echo "β
Cargo binary updated successfully!"
fi
echo "π Update complete! Your environment configurations were not touched."