feat: add FLOW_CONFIG_DIR env var to override configuration directory
closes #379
This commit is contained in:
parent
e2955f029d
commit
e9d336e336
1 changed files with 4 additions and 1 deletions
|
|
@ -854,7 +854,10 @@ fn get_app_config_dir(appname: []const u8) ConfigDirError![]const u8 {
|
|||
};
|
||||
const config_dir = if (local.config_dir) |dir|
|
||||
dir
|
||||
else if (std.process.getEnvVarOwned(a, "XDG_CONFIG_HOME") catch null) |xdg| ret: {
|
||||
else if (std.process.getEnvVarOwned(a, "FLOW_CONFIG_DIR") catch null) |dir| ret: {
|
||||
defer a.free(dir);
|
||||
break :ret try std.fmt.bufPrint(&local.config_dir_buffer, "{s}", .{dir});
|
||||
} else if (std.process.getEnvVarOwned(a, "XDG_CONFIG_HOME") catch null) |xdg| ret: {
|
||||
defer a.free(xdg);
|
||||
break :ret try std.fmt.bufPrint(&local.config_dir_buffer, "{s}{c}{s}", .{ xdg, sep, appname });
|
||||
} else if (std.process.getEnvVarOwned(a, "HOME") catch null) |home| ret: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue