-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
50 lines (42 loc) · 1.37 KB
/
install.sh
File metadata and controls
50 lines (42 loc) · 1.37 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
#!/usr/bin/env bash
# repo-stats installer
# Usage: bash install.sh
set -e
INSTALL_DIR="${HOME}/.local/bin"
SCRIPT_NAME="repo-stats"
SCRIPT_SRC="$(dirname "$0")/repo_stats.py"
echo "Installing repo-stats..."
# Ensure install dir exists
mkdir -p "$INSTALL_DIR"
# Copy script
cp "$SCRIPT_SRC" "$INSTALL_DIR/$SCRIPT_NAME"
chmod +x "$INSTALL_DIR/$SCRIPT_NAME"
# Check Python version
python3 -c "import sys; assert sys.version_info >= (3, 10), 'Python 3.10+ required'" 2>/dev/null || {
echo "Warning: Python 3.10+ is recommended."
}
# Check if ~/.local/bin is in PATH
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
echo ""
echo "NOTE: Add the following to your shell profile (~/.bashrc, ~/.zshrc, etc.):"
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
fi
echo ""
echo "✓ repo-stats installed to $INSTALL_DIR/$SCRIPT_NAME"
echo ""
echo "Usage:"
echo " repo-stats ."
echo " repo-stats /path/to/project"
echo " repo-stats https://github.com/user/repo"
echo " repo-stats user/repo"
echo ""
echo "Options:"
echo " --languages Language breakdown"
echo " --git Git history"
echo " --contributors Contributor analysis"
echo " --directories Directory structure"
echo " --todos TODO/FIXME markers"
echo " --deps Dependency detection"
echo " --health Code quality metrics"
echo " --json JSON output"
echo " --markdown Markdown output"