Fix issue with config script when home path doesn't exist

main
trivernis 1 year ago
parent 1a07de1c0a
commit e5c7d9016d
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -5,7 +5,12 @@ export def read_file [app: string, filename = "config.toml"] {
# returns the path to an apps config dir # returns the path to an apps config dir
export def get_path [app: string] { export def get_path [app: string] {
let local = ( $env.HOME | path join ".config" | path join $app ) let home = $env.HOME?
if $home == null {
"/etc" | path join $app
}
let local = ( $home | path join ".config" | path join $app )
if ( $local | path exists ) { if ( $local | path exists ) {
$local $local

Loading…
Cancel
Save