fix(config.ts): ensure setConfig is only called when there are entries to set to prevent unnecessary function calls

feat(run.ts): add conditional to skip migrations if OCO_AI_PROVIDER is set to TEST to improve migration handling during testing
This commit is contained in:
di-sukharev
2024-09-04 11:54:54 +03:00
parent d1f03f1105
commit 5209610236
4 changed files with 14 additions and 4 deletions

View File

@@ -30151,7 +30151,8 @@ var setDefaultConfigValues = (config7) => {
if (config7[key] === "undefined")
entriesToSet.push(entry);
}
setConfig(entriesToSet);
if (entriesToSet.length > 0)
setConfig(entriesToSet);
};
var setGlobalConfig = (config7, configPath = defaultConfigPath) => {
(0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(config7), "utf8");
@@ -45731,7 +45732,11 @@ var runMigrations = async () => {
}
}
if (isMigrated) {
ce("Migrations to your config were applied successfully. Please rerun.");
ce(
`${source_default.green(
"\u2714"
)} Migrations to your config were applied successfully. Please rerun.`
);
process.exit(0);
}
};

View File

@@ -48954,7 +48954,8 @@ var setDefaultConfigValues = (config6) => {
if (config6[key] === "undefined")
entriesToSet.push(entry);
}
setConfig(entriesToSet);
if (entriesToSet.length > 0)
setConfig(entriesToSet);
};
var setGlobalConfig = (config6, configPath = defaultConfigPath) => {
(0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(config6), "utf8");