Mercurial > repos > shellac > sam_consensus_v3
comparison env/bin/activate.fish @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
| author | shellac |
|---|---|
| date | Mon, 22 Mar 2021 18:12:50 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4f3585e2f14b |
|---|---|
| 1 # This file must be used with "source <venv>/bin/activate.fish" *from fish* | |
| 2 # (https://fishshell.com/); you cannot run it directly. | |
| 3 | |
| 4 function deactivate -d "Exit virtual environment and return to normal shell environment" | |
| 5 # reset old environment variables | |
| 6 if test -n "$_OLD_VIRTUAL_PATH" | |
| 7 set -gx PATH $_OLD_VIRTUAL_PATH | |
| 8 set -e _OLD_VIRTUAL_PATH | |
| 9 end | |
| 10 if test -n "$_OLD_VIRTUAL_PYTHONHOME" | |
| 11 set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME | |
| 12 set -e _OLD_VIRTUAL_PYTHONHOME | |
| 13 end | |
| 14 | |
| 15 if test -n "$_OLD_FISH_PROMPT_OVERRIDE" | |
| 16 functions -e fish_prompt | |
| 17 set -e _OLD_FISH_PROMPT_OVERRIDE | |
| 18 functions -c _old_fish_prompt fish_prompt | |
| 19 functions -e _old_fish_prompt | |
| 20 end | |
| 21 | |
| 22 set -e VIRTUAL_ENV | |
| 23 if test "$argv[1]" != "nondestructive" | |
| 24 # Self-destruct! | |
| 25 functions -e deactivate | |
| 26 end | |
| 27 end | |
| 28 | |
| 29 # Unset irrelevant variables. | |
| 30 deactivate nondestructive | |
| 31 | |
| 32 set -gx VIRTUAL_ENV "/Users/cmdms/OneDrive-UOB/Development/Projects/2021/sam-consensus-v3/env" | |
| 33 | |
| 34 set -gx _OLD_VIRTUAL_PATH $PATH | |
| 35 set -gx PATH "$VIRTUAL_ENV/bin" $PATH | |
| 36 | |
| 37 # Unset PYTHONHOME if set. | |
| 38 if set -q PYTHONHOME | |
| 39 set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME | |
| 40 set -e PYTHONHOME | |
| 41 end | |
| 42 | |
| 43 if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" | |
| 44 # fish uses a function instead of an env var to generate the prompt. | |
| 45 | |
| 46 # Save the current fish_prompt function as the function _old_fish_prompt. | |
| 47 functions -c fish_prompt _old_fish_prompt | |
| 48 | |
| 49 # With the original prompt function renamed, we can override with our own. | |
| 50 function fish_prompt | |
| 51 # Save the return status of the last command. | |
| 52 set -l old_status $status | |
| 53 | |
| 54 # Output the venv prompt; color taken from the blue of the Python logo. | |
| 55 printf "%s%s%s" (set_color 4B8BBE) "(env) " (set_color normal) | |
| 56 | |
| 57 # Restore the return status of the previous command. | |
| 58 echo "exit $old_status" | . | |
| 59 # Output the original/"old" prompt. | |
| 60 _old_fish_prompt | |
| 61 end | |
| 62 | |
| 63 set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" | |
| 64 end |
