-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
47 lines (37 loc) · 778 Bytes
/
install.sh
File metadata and controls
47 lines (37 loc) · 778 Bytes
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
#!/bin/bash
set -e
echo "📦 Installing bill..."
# Detect OS
OS="$(uname -s)"
case "$OS" in
Darwin)
FILE="bill-macos"
;;
Linux)
FILE="bill-linux"
;;
*)
echo "❌ Unsupported OS: $OS"
exit 1
;;
esac
# Temp directory
TMP_DIR=$(mktemp -d)
cd "$TMP_DIR"
# Download binary
echo "⬇️ Downloading latest release..."
curl -L -o bill "https://github.com/arpansource/bill/releases/download/v0.1.0/$FILE"
# Make executable
chmod +x bill
# Decide install directory
INSTALL_DIR="/usr/local/bin"
if [ ! -w "$INSTALL_DIR" ]; then
echo "🔐 Need sudo permissions to install to $INSTALL_DIR"
sudo mv bill "$INSTALL_DIR/bill"
else
mv bill "$INSTALL_DIR/bill"
fi
echo "✅ bill installed successfully!"
echo ""
echo "Run:"
echo " bill init"