19 lines
523 B
Bash
19 lines
523 B
Bash
if [[ -n "$(which-command direnv)" ]]; then
|
|
function _env() {
|
|
if [[ -z "$_DIRENV_ShowEnvLogic" ]]; then
|
|
echo "_DIRENV_ShowEnvLogic is not defined."
|
|
if [[ $# -gt 0 ]]; then
|
|
local _DIRENV_ShowEnvLogic='set'
|
|
printf "Searching environment for: '${@}'\n\n"
|
|
fi
|
|
fi
|
|
if [[ -n "$_DIRENV_ShowEnvLogic" ]]; then
|
|
FILTER=''
|
|
[[ $# -gt 0 ]] && FILTER="| grep ${@}"
|
|
eval "$_DIRENV_ShowEnvLogic | LC_ALL=C sort -h $FILTER"
|
|
fi
|
|
}
|
|
|
|
alias direnv-allow="direnv allow "
|
|
fi
|