-
-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathinstall.sh
More file actions
56 lines (45 loc) · 1.25 KB
/
Copy pathinstall.sh
File metadata and controls
56 lines (45 loc) · 1.25 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
#!/usr/bin/env sh
set -eu
REPO_URL="https://github.com/Zafer-Liu/Data-Analysis-Agent.git"
PROJECT_NAME="Data-Analysis-Agent"
INSTALL_DIR="$HOME/.data-analysis-agent"
PROJECT_DIR="$INSTALL_DIR/$PROJECT_NAME"
LAUNCHER="$HOME/.local/bin/data-analysis-agent"
info() {
printf '[Data-Analysis-Agent] %s\n' "$1"
}
if ! command -v python3 >/dev/null 2>&1; then
echo "Python3 not found. Please install Python 3.10+ first." >&2
exit 1
fi
if ! command -v git >/dev/null 2>&1; then
echo "Git not found. Please install Git first." >&2
exit 1
fi
mkdir -p "$INSTALL_DIR"
mkdir -p "$HOME/.local/bin"
if [ -d "$PROJECT_DIR" ]; then
info "Project already exists. Updating..."
cd "$PROJECT_DIR"
git pull
else
info "Cloning project..."
git clone "$REPO_URL" "$PROJECT_DIR"
cd "$PROJECT_DIR"
fi
info "Creating virtual environment..."
python3 -m venv .venv
info "Installing dependencies..."
.venv/bin/python -m pip install --upgrade pip
.venv/bin/pip install -r requirements.txt
cat > "$LAUNCHER" <<EOF
#!/usr/bin/env sh
cd "$PROJECT_DIR"
. ".venv/bin/activate"
python app.py
EOF
chmod +x "$LAUNCHER"
info "Installed successfully."
info "Start with: data-analysis-agent"
info "If command not found, add this to your shell config:"
info 'export PATH="$HOME/.local/bin:$PATH"'