Designate persistent and ephemeral direnv state
This commit is contained in:
parent
a15b26b0b4
commit
35881fbe3d
1 changed files with 5 additions and 1 deletions
|
@ -27,9 +27,13 @@ in
|
|||
direnv_layout_dir() {
|
||||
local hash name
|
||||
echo "''${direnv_layout_dirs[$PWD]:=$(
|
||||
case "$PWD" in
|
||||
"$HOME/project/"*|"$HOME/akorg/project/"*) store='user-state-cache';;
|
||||
*) store='user-runtime';;
|
||||
esac
|
||||
hash="$(sha256sum <<< "$PWD" | head --bytes 16)"
|
||||
name="''${PWD//\//-}"; name="''${name:1}"
|
||||
systemd-path --suffix "direnv/layouts/$name#$hash" 'user-state-cache'
|
||||
systemd-path --suffix "direnv/layouts/$name#$hash" "$store"
|
||||
)}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue