mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Honor XDG_CONFIG_HOME ENV variable
				
					
				
			Following XDG Spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
This commit is contained in:
		
							parent
							
								
									749da0984c
								
							
						
					
					
						commit
						102e2834b6
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -24,9 +24,10 @@ class Ameba::Config
 | 
				
			||||||
    json:     Formatter::JSONFormatter,
 | 
					    json:     Formatter::JSONFormatter,
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  XDG_CONFIG_HOME = ENV.fetch("XDG_CONFIG_HOME", "~/.config")
 | 
				
			||||||
  DEFAULT_PATHS   = {
 | 
					  DEFAULT_PATHS   = {
 | 
				
			||||||
    "~/.ameba.yml",
 | 
					    Path["~/.ameba.yml"],
 | 
				
			||||||
    "~/.config/ameba/config.yml",
 | 
					    Path[XDG_CONFIG_HOME] / "ameba/config.yml",
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  FILENAME     = ".ameba.yml"
 | 
					  FILENAME     = ".ameba.yml"
 | 
				
			||||||
  DEFAULT_PATH = Path[Dir.current] / FILENAME
 | 
					  DEFAULT_PATH = Path[Dir.current] / FILENAME
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue