Last active
February 25, 2021 03:38
Revisions
-
fisadev revised this gist
Feb 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # but stored under ~/venvs/ # e NAME --> create and/or activate a virtualenv with the specified name, stored under ~/venvs/ # you should replace `\/home\/fisa\/devel\/` (scaped text for `/home/fisa/devel/`) with the folder in which most # of your projects live, so a venv for a project /home/fisa/devel/company_x/project_y/ will be named just # "company_x_project_y", without the full path as part of the name. It's kind of a default prefix. -
fisadev created this gist
Feb 25, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ # usage: # e --> create and/or activate a virtualenv, named in a way that's unique and related to the current folder # but stored under ~/venvs/ # e NAME --> create and/or activate a virtualenv with the specified name, stored under ~/venvs/ # you should replace `\/home\/fisa\/devel\/` (scaped text for `/home/fisa/deve/`) with the folder in which most # of your projects live, so a venv for a project /home/fisa/devel/company_x/project_y/ will be named just # "company_x_project_y", without the full path as part of the name. It's kind of a default prefix. function e if count $argv > /dev/null set env_name $argv else set env_name (pwd | sed "s/\/home\/fisa\/devel\///g" | sed "s/\//_/g") end set env_dir ~/venvs/$env_name if not test -d $env_dir echo "No virtualenv named $env_name, creating a new one..." python3 -m venv $env_dir echo "Upgrading pip..." $env_dir/bin/pip install pip --upgrade echo "Done" end . $env_dir/bin/activate.fish end