Describe the bug
The migration to XDG_RUNTIME_DIR seems incomplete. The XDG_DATA_DIR value is being used instead of the XDG_RUNTIME_DIR value as the error message states.
The cache dir or data dir may actually be a better place for this tho since the value persists across shell instances. https://wiki.archlinux.org/index.php/XDG_Base_Directory (#notanexpert)
To Reproduce
in a "pre-migrated" state run direnv allow and get the following error:
Migrating the allow data to the new location
The allowed .envrc permissions used to be stored in the XDG_CONFIG_DIR. It's
better to keep that folder for user-editable configuration so the data is
being moved to XDG_RUNTIME_DIR.
moving /Users/adam/.config/direnv/allow to /Users/adam/.local/share/direnv/allow
direnv: error rename /Users/adam/.config/direnv/allow /Users/adam/.local/share/direnv/allow: no such file or directory
my current environment is set up as such:
XDG_CACHE_HOME=/Users/adam/.cache
XDG_CONFIG_HOME=/Users/adam/.config
XDG_DATA_HOME=/Users/adam/.local/share
XDG_RUNTIME_DIR=/Users/adam/.runtime
note that the "move to" location is using XDG_DATA_HOME, not XDG_RUNTIME_DIR.
Expected behavior
use the env var XDG_RUNTIME_DIR as stated.
Environment
so fast! thank you :)
see, that helps :)
sorry for being grumpy
XDG_DATA_HOME has a weird location but I want the info to persist so XDG_CACHE_HOME and XDG_RUNTIME_DIR are not really appropriate I think. It should be treated more like asset files that are generated by the user.
I had to manually create some folders for the migration to work:
mkdir -p ~/.local/share/direnv
Most helpful comment
I had to manually create some folders for the migration to work:
mkdir -p ~/.local/share/direnv