-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstaller.sh
More file actions
48 lines (40 loc) · 946 Bytes
/
Copy pathinstaller.sh
File metadata and controls
48 lines (40 loc) · 946 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
# Repo URL
REPO_URL="https://github.com/borystereschenko/Hackthon"
REPO_DIR="Hackthon"
MAIN_FILE="app.py"
# 1. Clone repo if not exists
if [ ! -d "$REPO_DIR" ]; then
echo "Cloning repository..."
git clone "$REPO_URL"
else
echo "Updating repository..."
cd "$REPO_DIR"
git pull
cd ..
fi
cd "$REPO_DIR"
# 2. Create venv if not exists
if [ ! -d ".venv" ]; then
echo "Creating virtual environment..."
python3 -m venv .venv
fi
# 3. Activate venv
source .venv/bin/activate
# 4. Install requirements (if exists)
if [ -f "requirements.txt" ]; then
echo "Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
else
echo "No requirements.txt found. Skipping dependency installation."
fi
# 5. Run main file
if [ -f "$MAIN_FILE" ]; then
echo "Running $MAIN_FILE..."
streamlit run "$MAIN_FILE"
else
echo "$MAIN_FILE not found!"
exit 1
fi