fix the logic generating the config file

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2023-03-16 20:40:05 +01:00 committed by Matthieu Gallien
parent 85a2020982
commit d2cd4efaaa

View File

@ -332,13 +332,25 @@ Application::Application(int &argc, char **argv)
ConfigFile cfg;
{
auto shouldExit = false;
// these config values will always be empty after the first client run
if (!_overrideServerUrl.isEmpty()) {
cfg.setOverrideServerUrl(_overrideServerUrl);
cfg.setOverrideServerUrl(_overrideServerUrl);
shouldExit = true;
}
if (!_overrideLocalDir.isEmpty()) {
cfg.setOverrideLocalDir(_overrideLocalDir);
shouldExit = true;
}
if (AccountSetupCommandLineManager::instance()) {
cfg.setVfsEnabled(AccountSetupCommandLineManager::instance()->isVfsEnabled());
}
if (shouldExit) {
std::exit(0);
}
}