mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 07:21:23 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -83,13 +83,17 @@ function pickBackendConfig(
|
||||
normalizedId: string,
|
||||
): CliBackendConfig | undefined {
|
||||
for (const [key, entry] of Object.entries(config)) {
|
||||
if (normalizeBackendKey(key) === normalizedId) return entry;
|
||||
if (normalizeBackendKey(key) === normalizedId) {
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function mergeBackendConfig(base: CliBackendConfig, override?: CliBackendConfig): CliBackendConfig {
|
||||
if (!override) return { ...base };
|
||||
if (!override) {
|
||||
return { ...base };
|
||||
}
|
||||
return {
|
||||
...base,
|
||||
...override,
|
||||
@@ -126,18 +130,26 @@ export function resolveCliBackendConfig(
|
||||
if (normalized === "claude-cli") {
|
||||
const merged = mergeBackendConfig(DEFAULT_CLAUDE_BACKEND, override);
|
||||
const command = merged.command?.trim();
|
||||
if (!command) return null;
|
||||
if (!command) {
|
||||
return null;
|
||||
}
|
||||
return { id: normalized, config: { ...merged, command } };
|
||||
}
|
||||
if (normalized === "codex-cli") {
|
||||
const merged = mergeBackendConfig(DEFAULT_CODEX_BACKEND, override);
|
||||
const command = merged.command?.trim();
|
||||
if (!command) return null;
|
||||
if (!command) {
|
||||
return null;
|
||||
}
|
||||
return { id: normalized, config: { ...merged, command } };
|
||||
}
|
||||
|
||||
if (!override) return null;
|
||||
if (!override) {
|
||||
return null;
|
||||
}
|
||||
const command = override.command?.trim();
|
||||
if (!command) return null;
|
||||
if (!command) {
|
||||
return null;
|
||||
}
|
||||
return { id: normalized, config: { ...override, command } };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user