Compare commits
2 Commits
0edc8467fd
...
43350eaa41
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43350eaa41 | ||
|
|
782ef16107 |
6
penv
6
penv
@@ -12,7 +12,7 @@ usage() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Usage: penv <command> <args>"
|
echo "Usage: penv <command> <args>"
|
||||||
echo "Commands:"
|
echo "Commands:"
|
||||||
echo " - new <name> <opt:version> - Create a new environment, optional, defaults to system's default python"
|
echo " - new <name> <ver=default> - Create a new environment, optional, defaults to system's default python"
|
||||||
echo " ex: penv new tools 3.13 -> creates new environment by the name tools, using Python 3.13"
|
echo " ex: penv new tools 3.13 -> creates new environment by the name tools, using Python 3.13"
|
||||||
echo " ex: penv new main -> creates new env with the name main, using the default Python version on the system"
|
echo " ex: penv new main -> creates new env with the name main, using the default Python version on the system"
|
||||||
echo " - del <name> - Delete existing environment"
|
echo " - del <name> - Delete existing environment"
|
||||||
@@ -86,12 +86,14 @@ delete(){
|
|||||||
read -r -n 1 -p "Remove environment $name (y/N)? " choise
|
read -r -n 1 -p "Remove environment $name (y/N)? " choise
|
||||||
case $choise in
|
case $choise in
|
||||||
[yY])
|
[yY])
|
||||||
|
size=$(du "$HOME"/.envs/"$name" -sh | cut -f1)
|
||||||
source "$HOME"/.envs/"$name"/bin/activate
|
source "$HOME"/.envs/"$name"/bin/activate
|
||||||
echo
|
echo
|
||||||
echo Spec $(jupyter-kernelspec remove -f -y "$name")
|
echo Spec $(jupyter-kernelspec remove -f -y "$name")
|
||||||
deactivate
|
deactivate
|
||||||
rm -r "$HOME/.envs/$name"
|
rm -r "$HOME/.envs/$name"
|
||||||
echo "Data Removed $HOME/.envs/$name"
|
echo "Data Removed $HOME/.envs/$name"
|
||||||
|
echo "Reclaimed $size"
|
||||||
;;
|
;;
|
||||||
[nN])
|
[nN])
|
||||||
echo ""
|
echo ""
|
||||||
@@ -180,7 +182,7 @@ uninstall() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pyls(){
|
pyls(){
|
||||||
ls /usr/bin/python3.* /usr/local/bin/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