diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Config.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Config.zig b/src/Config.zig index 2e6c388..e7afd76 100644 --- a/src/Config.zig +++ b/src/Config.zig | |||
| @@ -31,13 +31,13 @@ pub fn readConfig(allocator: Allocator) !Config { | |||
| 31 | 31 | ||
| 32 | if (env_map.get("XDG_CONFIG_HOME")) |base_dir| { | 32 | if (env_map.get("XDG_CONFIG_HOME")) |base_dir| { |
| 33 | try readConfigInBaseDir(allocator, &config, base_dir); | 33 | try readConfigInBaseDir(allocator, &config, base_dir); |
| 34 | } else { | 34 | } else if (env_map.get("HOME")) |home| { |
| 35 | // TODO: Maybe return an error instead of .? | ||
| 36 | const home = env_map.get("HOME").?; | ||
| 37 | const home_config = try std.fs.path.join(allocator, &.{ home, ".config" }); | 35 | const home_config = try std.fs.path.join(allocator, &.{ home, ".config" }); |
| 38 | defer allocator.free(home_config); | 36 | defer allocator.free(home_config); |
| 39 | 37 | ||
| 40 | try readConfigInBaseDir(allocator, &config, home_config); | 38 | try readConfigInBaseDir(allocator, &config, home_config); |
| 39 | } else { | ||
| 40 | std.log.err("No $HOME environment variable available!", .{}); | ||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | return config; | 43 | return config; |