Skip to content

Commit

Permalink
fix fallback for xdg dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
siph committed Mar 30, 2024
1 parent 25a7025 commit 5e2ddc6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yt-watcher/config.nu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ export def get_config [
]: nothing -> record<query: record,loop: bool,verbose: bool, output: string, channels: list<string>> {
let config_file = (
if ($config_file_path == null) {
$"($env.XDG_CONFIG_HOME)/yt-watcher/config.yaml"
try {
$"($env.XDG_CONFIG_HOME)/yt-watcher/config.yaml"
} catch {
log warning "Cannot find env var `XDG_CONFIG_HOME` falling back to `HOME`"
$"($env.HOME)/yt-watcher/config.yaml"
}
} else { $config_file_path }
)

Expand Down

0 comments on commit 5e2ddc6

Please sign in to comment.