Skip to content

Commit acf7a87

Browse files
SilentWoofSilentWoof
authored andcommitted
Initializes a Python virtual environment, sets up working directories, reusable testvenv alias to .bashrc.
1 parent e7f8a30 commit acf7a87

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

testvenv_setup.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# setup_testing_venv.sh — Create testing_venv and link alias to ~/tests
3+
4+
echo "[SETUP] Creating ~/venvs and ~/tests directories..."
5+
mkdir -p ~/venvs
6+
mkdir -p ~/tests
7+
8+
echo "[SETUP] Creating virtual environment: testing_venv"
9+
python3 -m venv ~/venvs/testing_venv
10+
11+
echo "[SETUP] Adding alias to ~/.bashrc"
12+
ALIAS_LINE="alias testvenv='source ~/venvs/testing_venv/bin/activate && cd ~/tests'"
13+
if ! grep -Fxq "$ALIAS_LINE" ~/.bashrc; then
14+
echo "$ALIAS_LINE" >> ~/.bashrc
15+
echo "[SETUP] Alias added to .bashrc"
16+
else
17+
echo "[INFO] Alias already exists in .bashrc"
18+
fi
19+
20+
echo "[SETUP] Reloading .bashrc"
21+
source ~/.bashrc
22+
23+
echo "[DONE] You can now run: testvenv"

0 commit comments

Comments
 (0)