Readable direnv cache directories
This commit is contained in:
parent
e6b6cdaab0
commit
dbae5eb0b3
1 changed files with 4 additions and 2 deletions
6
direnvrc
6
direnvrc
|
|
@ -1,8 +1,10 @@
|
|||
: ${XDG_CACHE_HOME:=$HOME/.cache}
|
||||
declare -A direnv_layout_dirs
|
||||
direnv_layout_dir() {
|
||||
local hash path
|
||||
echo "${direnv_layout_dirs[$PWD]:=$(
|
||||
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
|
||||
echo -n "$PWD" | sha1sum | cut -d ' ' -f 1
|
||||
hash="$(sha1sum - <<< "$PWD" | head -c40)"
|
||||
path="${PWD//[^a-zA-Z0-9]/-}"
|
||||
echo "${XDG_CACHE_HOME}/direnv/layouts/${hash}${path}"
|
||||
)}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue