-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreq.sh
More file actions
32 lines (24 loc) · 816 Bytes
/
req.sh
File metadata and controls
32 lines (24 loc) · 816 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
#!/bin/sh
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
python3 -m venv venv
echo "Virtual environment created in ./venv"
else
echo "Virtual environment already exists in ./venv"
fi
# Get the parent process name (actual shell)
current_shell="$(ps -p $(ps -p $$ -o ppid=) -o comm=)"
# Trim whitespace
current_shell="$(echo "$current_shell" | xargs)"
if [ "$current_shell" = "bash" ]; then
echo "Activating virtual environment for Bash..."
. venv/bin/activate
echo "[*] Pip installing nodeenv"
pip install nodeenv
echo "[*] Installing node through nodeenv"
nodeenv -p --node=22.13.0
else
echo "Detected shell: $current_shell"
echo "To activate the virtual environment manually, run alternative for:"
echo ". venv/bin/activate"
fi