mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Add direnv support
This commit is contained in:
parent
d52e1d1f82
commit
52e20aca38
5 changed files with 28 additions and 0 deletions
21
shell/direnv
Executable file
21
shell/direnv
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
if command -v direnv 2>&1 >/dev/null; then
|
||||
if [[ -n $BASH_VERSION ]]; then
|
||||
# eval "$(direnv hook bash)"
|
||||
_direnv_hook() {
|
||||
local previous_exit_status=$?;
|
||||
trap -- '' SIGINT;
|
||||
eval "$("${HOME}/.nix-profile/bin/direnv" export bash)";
|
||||
trap - SIGINT;
|
||||
return $previous_exit_status;
|
||||
};
|
||||
fi
|
||||
if [[ -n $ZSH_VERSION ]]; then
|
||||
# eval "$(direnv hook zsh)"
|
||||
_direnv_hook() {
|
||||
trap -- '' SIGINT;
|
||||
eval "$("${HOME}/.nix-profile/bin/direnv" export zsh)";
|
||||
trap - SIGINT;
|
||||
}
|
||||
fi
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue