add multi shell init, fixes #8
All checks were successful
/ Lint Check Shellscripts (push) Successful in 16s
All checks were successful
/ Lint Check Shellscripts (push) Successful in 16s
This commit is contained in:
11
penv
11
penv
@@ -150,10 +150,17 @@ install() {
|
|||||||
. \$HOME/.envs/\$1/bin/activate
|
. \$HOME/.envs/\$1/bin/activate
|
||||||
}
|
}
|
||||||
" > "$HOME"/.envs/.penv.funcs
|
" > "$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"
|
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() {
|
uninstall() {
|
||||||
if [[ -n "$VIRTUAL_ENV" ]]; then
|
if [[ -n "$VIRTUAL_ENV" ]]; then
|
||||||
echo "Deactivate the existing environment before uninstalling"
|
echo "Deactivate the existing environment before uninstalling"
|
||||||
@@ -182,7 +189,7 @@ uninstall() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pyls(){
|
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
|
if [ "$#" -lt 1 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user