diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2018-11-04 03:12:01 +0800 |
---|---|---|
committer | Kyrylo Silin <silin@kyrylo.org> | 2018-11-04 03:12:01 +0800 |
commit | e9d1be0e17b294318dbb2f70f74a50486cfa044c (patch) | |
tree | febfe7edfd176f7c1d4ef42971a641ff7c065744 | |
parent | e595daa0b1df67446f85b85412b330d29a2412b6 (diff) | |
download | pry-e9d1be0e17b294318dbb2f70f74a50486cfa044c.tar.gz |
config/default: use XDG_DATA_HOME, not XDG_CACHE_HOME for history
It turns out cache is supposed to be purgeable without losing information and we
don't want to lose history.
Thanks to @SirNerdBear for pointing out
(https://github.com/pry/pry/issues/1316#issuecomment-435611191)
-rw-r--r-- | lib/pry/config/default.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pry/config/default.rb b/lib/pry/config/default.rb index fa351f7c..928df4e8 100644 --- a/lib/pry/config/default.rb +++ b/lib/pry/config/default.rb @@ -122,12 +122,12 @@ class Pry history_file = if File.exist?(File.expand_path('~/.pry_history')) '~/.pry_history' - elsif ENV.key?('XDG_CACHE_HOME') && ENV['XDG_CACHE_HOME'] != '' + elsif ENV.key?('XDG_DATA_HOME') && ENV['XDG_DATA_HOME'] != '' # See XDG Base Directory Specification at # https://standards.freedesktop.org/basedir-spec/basedir-spec-0.8.html - ENV['XDG_CACHE_HOME'] + '/pry/pry_history' + ENV['XDG_DATA_HOME'] + '/pry/pry_history' else - '~/.cache/pry/pry_history' + '~/.local/share/pry/pry_history' end history.file = File.expand_path(history_file) end |