doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
649 stars 87 forks source link

dirs: Fallback to cache dir if no runtime dir #4

Closed AdmiralNemo closed 4 years ago

AdmiralNemo commented 4 years ago

The XDG_RUNTIME_DIR environment variable is not always set. It is mostly used by Linux distributions that use systemd; others may or may not use it.

There is no general consensus on the appropriate location for sockets, pipes, PID files, etc. in the absence of a specified runtime directory. Historically, applications would create a "dot directory" (e.g. ~/.gnupg) and store all of their files there. Some applications, including libvirt and gnome-keyring, use the cache directory, while others (e.g. many Electron-based applications) store everything in the configuration directory. Finally, there is the age-old tradition of putting everything in /tmp.

This commit adds fallback logic anywhere the runtime directory is used. If the runtime directory is not configured, the cache directory is used in its place.

Fixes #3

doy commented 4 years ago

hey, sorry, i had just fixed this right before you submitted this pull request. thanks though!