mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 14:41:42 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -148,7 +148,9 @@ async function handleMissingSandboxImage(
|
||||
prompter: DoctorPrompter,
|
||||
) {
|
||||
const exists = await dockerImageExists(params.image);
|
||||
if (exists) return;
|
||||
if (exists) {
|
||||
return;
|
||||
}
|
||||
|
||||
const buildHint = params.buildScript
|
||||
? `Build it with ${params.buildScript}.`
|
||||
@@ -166,7 +168,9 @@ async function handleMissingSandboxImage(
|
||||
}
|
||||
}
|
||||
|
||||
if (built) return;
|
||||
if (built) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
export async function maybeRepairSandboxImages(
|
||||
@@ -176,7 +180,9 @@ export async function maybeRepairSandboxImages(
|
||||
): Promise<OpenClawConfig> {
|
||||
const sandbox = cfg.agents?.defaults?.sandbox;
|
||||
const mode = sandbox?.mode ?? "off";
|
||||
if (!sandbox || mode === "off") return cfg;
|
||||
if (!sandbox || mode === "off") {
|
||||
return cfg;
|
||||
}
|
||||
|
||||
const dockerAvailable = await isDockerAvailable();
|
||||
if (!dockerAvailable) {
|
||||
@@ -238,14 +244,18 @@ export function noteSandboxScopeWarnings(cfg: OpenClawConfig) {
|
||||
for (const agent of agents) {
|
||||
const agentId = agent.id;
|
||||
const agentSandbox = agent.sandbox;
|
||||
if (!agentSandbox) continue;
|
||||
if (!agentSandbox) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const scope = resolveSandboxScope({
|
||||
scope: agentSandbox.scope ?? globalSandbox?.scope,
|
||||
perSession: agentSandbox.perSession ?? globalSandbox?.perSession,
|
||||
});
|
||||
|
||||
if (scope !== "shared") continue;
|
||||
if (scope !== "shared") {
|
||||
continue;
|
||||
}
|
||||
|
||||
const overrides: string[] = [];
|
||||
if (agentSandbox.docker && Object.keys(agentSandbox.docker).length > 0) {
|
||||
@@ -258,7 +268,9 @@ export function noteSandboxScopeWarnings(cfg: OpenClawConfig) {
|
||||
overrides.push("prune");
|
||||
}
|
||||
|
||||
if (overrides.length === 0) continue;
|
||||
if (overrides.length === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
warnings.push(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user