-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·40 lines (35 loc) · 1.11 KB
/
setup.sh
File metadata and controls
executable file
·40 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
#!/bin/bash
mkdir -p "$HOME/.local/{bin,share}"
export PATH="$HOME/.local/bin:$PATH"
# check if uv exists, if not install it
if ! command -v uv &>/dev/null; then
echo "uv could not be found, installing..."
if command -v wget &>/dev/null; then
wget -qO- https://astral.sh/uv/install.sh | sh
elif command -v curl &>/dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
elif command -v pip &>/dev/null; then
pip install uv
else
echo "Error: Could not find wget, curl, or pip to install uv. Please install one of these tools and try again."
exit 1
fi
if [ $? -ne 0 ]; then
echo "Error: Failed to install uv. Please check the installation logs and try again."
exit 1
fi
else
echo "uv is already installed."
fi
if ! command -v uv &>/dev/null; then
echo "Error: uv is not installed. Please install uv and try again."
exit 1
fi
# check if .venv exists, if not create it
if [ ! -d ".venv" ]; then
uv venv --python 3.11.11
else
echo ".venv already exists."
fi
# activate the virtual environment
source .venv/bin/activate