refactor: loadConfig 统一走 mergeConfig 路径
This commit is contained in:
@@ -25,12 +25,9 @@ export async function loadConfig(projectRoot: string): Promise<RuneConfig> {
|
||||
try {
|
||||
const content = await readFile(configPath, "utf-8");
|
||||
const userConfig = parseYaml(content) as Partial<RuneConfig> | null;
|
||||
if (!userConfig?.stages) {
|
||||
return structuredClone(defaultConfig);
|
||||
}
|
||||
return mergeConfig(userConfig);
|
||||
return mergeConfig(userConfig ?? {});
|
||||
} catch {
|
||||
return structuredClone(defaultConfig);
|
||||
return mergeConfig({});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user