os: allow using XDG_CACHE_HOME for choosing the folder returned by `os.cache_dir()` on windows too
parent
5071a54b99
commit
bad30bdd79
|
@ -615,12 +615,10 @@ pub fn cache_dir() string {
|
|||
// $XDG_CACHE_HOME defines the base directory relative to which user specific
|
||||
// non-essential data files should be stored. If $XDG_CACHE_HOME is either not set
|
||||
// or empty, a default equal to $HOME/.cache should be used.
|
||||
$if !windows {
|
||||
xdg_cache_home := getenv('XDG_CACHE_HOME')
|
||||
if xdg_cache_home != '' {
|
||||
return xdg_cache_home
|
||||
}
|
||||
}
|
||||
cdir := join_path_single(home_dir(), '.cache')
|
||||
if !is_dir(cdir) && !is_link(cdir) {
|
||||
mkdir(cdir) or { panic(err) }
|
||||
|
|
Loading…
Reference in New Issue