add multi shell init, fixes #8
All checks were successful
/ Lint Check Shellscripts (push) Successful in 16s

This commit is contained in:
Phani Pavan K
2026-02-06 13:09:17 +05:30
parent 43350eaa41
commit a64bd7c8a6

11
penv
View File

@@ -150,10 +150,17 @@ install() {
. \$HOME/.envs/\$1/bin/activate
}
" > "$HOME"/.envs/.penv.funcs
grep -qxF "source \$HOME/.envs/.penv.funcs" "$HOME"/.bashrc || echo "source \$HOME/.envs/.penv.funcs" >> "$HOME"/.bashrc
add2RC bashrc
add2RC zshrc
echo "Initialized PENV. Restart the shell"
}
add2RC(){
if [[ -f "$HOME/.$1" ]]; then
grep -qxF "source \$HOME/.envs/.penv.funcs" "$HOME/.$1" || echo "source \$HOME/.envs/.penv.funcs" >> "$HOME/.$1"
fi
}
uninstall() {
if [[ -n "$VIRTUAL_ENV" ]]; then
echo "Deactivate the existing environment before uninstalling"
@@ -182,7 +189,7 @@ uninstall() {
}
pyls(){
find /usr/local/bin /usr/bin -name python3.* 2> /dev/null | tr " " "\n" | grep "3.*" --color=always
find /usr/local/bin /usr/bin -name "python3.*" 2> /dev/null | tr " " "\n" | grep "3.*" --color=always
}
if [ "$#" -lt 1 ]; then