11 lines
297 B
Bash
11 lines
297 B
Bash
|
_direnv_hook() {
|
||
|
local previous_exit_status=$?;
|
||
|
trap -- '' SIGINT;
|
||
|
eval "$("/usr/local/bin/direnv" export bash)";
|
||
|
trap - SIGINT;
|
||
|
return $previous_exit_status;
|
||
|
};
|
||
|
if ! [[ "${PROMPT_COMMAND:-}" =~ _direnv_hook ]]; then
|
||
|
PROMPT_COMMAND="_direnv_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
|
||
|
fi
|