mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Global: handles missing config directories more gracefully
This commit is contained in:
@@ -258,6 +258,8 @@ static uint32_t getAMSystem(FFstrbuf* baseDir)
|
||||
|
||||
static uint32_t getAMUser(void)
|
||||
{
|
||||
if (instance.state.platform.configDirs.length == 0) return 0;
|
||||
|
||||
// check if $XDG_CONFIG_HOME/appman/appman-config exists
|
||||
FFstrbuf* baseDir = FF_LIST_GET(FFstrbuf, instance.state.platform.configDirs, 0);
|
||||
uint32_t baseLen = baseDir->length;
|
||||
|
||||
@@ -435,6 +435,12 @@ static void generateConfigFile(bool force, const char* filePath, bool fullConfig
|
||||
{
|
||||
if (!filePath)
|
||||
{
|
||||
if (instance.state.platform.configDirs.length == 0)
|
||||
{
|
||||
fprintf(stderr, "Error: No config directory found to generate config file in. Use --gen-config <path> to specify a path\n");
|
||||
exit(477);
|
||||
}
|
||||
|
||||
ffStrbufSet(&instance.state.genConfigPath, FF_LIST_GET(FFstrbuf, instance.state.platform.configDirs, 0));
|
||||
ffStrbufAppendS(&instance.state.genConfigPath, "fastfetch/config.jsonc");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user