-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add environment file for fish shell support
fixes #104
- Loading branch information
1 parent
2818ae7
commit 7d6d2c1
Showing
7 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env fish | ||
|
||
function deactivate -d "Deactivate the ___BRANDING___ virtual environment" | ||
|
||
if set --query _OLD_ENVIRONMENT_PATH | ||
set --export PATH $_OLD_ENVIRONMENT_PATH | ||
set --erase _OLD_ENVIRONMENT_PATH | ||
end | ||
|
||
if set --query _OLD_ENVIRONMENT_PYTHONHOME | ||
set --export PYTHONHOME $_OLD_ENVIRONMENT_PYTHONHOME | ||
set --erase _OLD_ENVIRONMENT_PYTHONHOME | ||
end | ||
|
||
set --erase VIRTUAL_ENV | ||
set --erase VERILATOR_ROOT | ||
set --erase GHDL_PREFIX | ||
|
||
if functions --query _old_environment_fish_prompt | ||
functions --erase fish_prompt | ||
functions --copy _old_environment_fish_prompt fish_prompt | ||
functions --erase _old_environment_fish_prompt | ||
end | ||
|
||
if test (count $argv) -eq 0; or test $argv[1] != "nondestructive" | ||
functions --erase deactivate | ||
end | ||
|
||
end | ||
|
||
deactivate nondestructive | ||
|
||
set --local release_current_dir (dirname (status -f)) | ||
|
||
if test (uname) = "Darwin" | ||
set --global release_topdir_abs ($release_current_dir/libexec/realpath $release_current_dir) | ||
else | ||
set --global release_topdir_abs (realpath $release_current_dir) | ||
end | ||
|
||
set --export VIRTUAL_ENV '___BRANDING___' | ||
|
||
set --global _OLD_ENVIRONMENT_PATH "$PATH" | ||
set --export PATH "$release_topdir_abs/bin:$release_topdir_abs/py3bin:$PATH" | ||
|
||
if set --query PYTHONHOME | ||
set --export _OLD_ENVIRONMENT_PYTHONHOME "$PYTHONHOME" | ||
set --erase PYTHONHOME | ||
end | ||
|
||
functions --copy fish_prompt _old_environment_fish_prompt | ||
function fish_prompt -d "Write out the prompt" | ||
set_color magenta | ||
echo -n -s '(' $VIRTUAL_ENV ') ' | ||
set_color normal | ||
_old_environment_fish_prompt | ||
end | ||
|
||
set --export VERILATOR_ROOT "$release_topdir_abs/share/verilator" | ||
set --export GHDL_PREFIX "$release_topdir_abs/lib/ghdl" |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters