os: allow using XDG_CACHE_HOME for choosing the folder returned by `os.cache_dir()` on windows too
							parent
							
								
									5071a54b99
								
							
						
					
					
						commit
						bad30bdd79
					
				| 
						 | 
					@ -615,11 +615,9 @@ pub fn cache_dir() string {
 | 
				
			||||||
	// $XDG_CACHE_HOME defines the base directory relative to which user specific
 | 
						// $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
 | 
						// 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.
 | 
						// or empty, a default equal to $HOME/.cache should be used.
 | 
				
			||||||
	$if !windows {
 | 
						xdg_cache_home := getenv('XDG_CACHE_HOME')
 | 
				
			||||||
		xdg_cache_home := getenv('XDG_CACHE_HOME')
 | 
						if xdg_cache_home != '' {
 | 
				
			||||||
		if xdg_cache_home != '' {
 | 
							return xdg_cache_home
 | 
				
			||||||
			return xdg_cache_home
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	cdir := join_path_single(home_dir(), '.cache')
 | 
						cdir := join_path_single(home_dir(), '.cache')
 | 
				
			||||||
	if !is_dir(cdir) && !is_link(cdir) {
 | 
						if !is_dir(cdir) && !is_link(cdir) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue