feat: Add direnv module and add configuration

This commit is contained in:
ulic-youthlic 2025-11-02 12:50:13 +08:00
parent fe6e4f4c0b
commit 7846b4e745
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
3 changed files with 32 additions and 4 deletions

View file

@ -0,0 +1,10 @@
: "${XDG_CACHE_HOME:=$HOME/.cache}"
declare -A direnv_layout_dirs
function direnv_layout_dir() {
local hash path
echo "${direnv_layout_dirs[$PWD]:=$(
hash="$(sha1sum - <<<"$PWD" | head -c40)"
path="${PWD//[^a-zA-Z0-9]/-}"
echo "${XDG_CACHE_HOME}/direnv/layouts/${hash}${path}"
)}"
}