-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·45 lines (35 loc) · 1.11 KB
/
setup.sh
File metadata and controls
executable file
·45 lines (35 loc) · 1.11 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
#!/bin/bash
set -e
echo "🔧 Setting up Command Tracker (Arch Linux friendly)..."
# Check Python
if ! command -v python3 &>/dev/null; then
echo "❌ Python3 is not installed."
exit 1
fi
# Create virtual environment
echo "🐍 Creating virtual environment..."
python3 -m venv .venv
# Activate it and install dependencies
echo "📦 Installing Python dependencies inside virtual environment..."
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
# Create symlink for 'showcmm'
echo "🔗 Adding 'showcmm' command..."
chmod +x main.py
sudo ln -sf "$(pwd)/main.py" /usr/local/bin/showcmm
# Install man page
MAN_PAGE="showcmm.1"
MAN_DIR="/usr/local/share/man/man1"
if [[ -f "$MAN_PAGE" ]]; then
echo "📘 Installing man page..."
sudo mkdir -p "$MAN_DIR"
sudo cp "$MAN_PAGE" "$MAN_DIR/"
sudo gzip -f "$MAN_DIR/$MAN_PAGE"
echo "✅ Man page installed."
else
echo "⚠️ No man page found. Skipping."
fi
echo "✅ Setup complete!"
echo "👉 Run the app using: showcmm"
echo "👉 If you want to use the virtual environment manually, run: source .venv/bin/activate"