From 1afe6734059d963dc934f7e1293747f833a16c5d Mon Sep 17 00:00:00 2001 From: dsisnero Date: Thu, 12 Jan 2023 16:37:17 -0700 Subject: [PATCH] prefer XDG_CACHE_HOME before os specific cache directories I think the correct logic is to use XDG_CACHE_HOME if it is given and if not, use platform defaults --- lib/datasets/cache-path.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/datasets/cache-path.rb b/lib/datasets/cache-path.rb index aa061759..4a418f27 100644 --- a/lib/datasets/cache-path.rb +++ b/lib/datasets/cache-path.rb @@ -15,13 +15,14 @@ def remove private def system_cache_dir + return ENV['XDG_CACHE_HOME'] if ENV['XDG_CACHE_HOME'] case RUBY_PLATFORM when /mswin/, /mingw/ ENV['LOCALAPPDATA'] || '~/AppData/Local' when /darwin/ '~/Library/Caches' else - ENV['XDG_CACHE_HOME'] || '~/.cache' + '~/.cache' end end end