From bb85f90f7804dada5c6b0a2fae81db514b60732d Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 25 Jun 2021 04:01:52 -0700 Subject: [PATCH] FEXConfig: Have it create AppConfig folder on save Otherwise it will claim that the AppConfig was saved and won't actually be --- .../FEXCore/Source/Interface/Config/Config.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/External/FEXCore/Source/Interface/Config/Config.cpp b/External/FEXCore/Source/Interface/Config/Config.cpp index af977ab45..5178d72ab 100644 --- a/External/FEXCore/Source/Interface/Config/Config.cpp +++ b/External/FEXCore/Source/Interface/Config/Config.cpp @@ -90,10 +90,21 @@ namespace FEXCore::Config { !std::filesystem::create_directories(ConfigFile)) { LogMan::Msg::D("Couldn't create config directory: '%s'", ConfigFile.c_str()); // Let's go local in this case - return "./"; + return "./" + Filename + ".json"; } - ConfigFile += "AppConfig/" + Filename + ".json"; + ConfigFile += "AppConfig/"; + + // Attempt to create the local folder if it doesn't exist + if (!Global && + !std::filesystem::exists(ConfigFile) && + !std::filesystem::create_directories(ConfigFile)) { + LogMan::Msg::D("Couldn't create AppConfig directory: '%s'", ConfigFile.c_str()); + // Let's go local in this case + return "./" + Filename + ".json"; + } + + ConfigFile += Filename + ".json"; return ConfigFile; }