mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 18:34:33 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -15,11 +15,15 @@ function resolveHomeDir(): string {
|
||||
}
|
||||
|
||||
export async function noteMacLaunchAgentOverrides() {
|
||||
if (process.platform !== "darwin") return;
|
||||
if (process.platform !== "darwin") {
|
||||
return;
|
||||
}
|
||||
const home = resolveHomeDir();
|
||||
const markerCandidates = [path.join(home, ".openclaw", "disable-launchagent")];
|
||||
const markerPath = markerCandidates.find((candidate) => fs.existsSync(candidate));
|
||||
if (!markerPath) return;
|
||||
if (!markerPath) {
|
||||
return;
|
||||
}
|
||||
|
||||
const displayMarkerPath = shortenHomePath(markerPath);
|
||||
const lines = [
|
||||
@@ -61,8 +65,12 @@ export async function noteMacLaunchctlGatewayEnvOverrides(
|
||||
},
|
||||
) {
|
||||
const platform = deps?.platform ?? process.platform;
|
||||
if (platform !== "darwin") return;
|
||||
if (!hasConfigGatewayCreds(cfg)) return;
|
||||
if (platform !== "darwin") {
|
||||
return;
|
||||
}
|
||||
if (!hasConfigGatewayCreds(cfg)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const getenv = deps?.getenv ?? launchctlGetenv;
|
||||
const deprecatedLaunchctlEntries = [
|
||||
@@ -94,7 +102,9 @@ export async function noteMacLaunchctlGatewayEnvOverrides(
|
||||
const envPassword = passwordEntry?.[1]?.trim() ?? "";
|
||||
const envTokenKey = tokenEntry?.[0];
|
||||
const envPasswordKey = passwordEntry?.[0];
|
||||
if (!envToken && !envPassword) return;
|
||||
if (!envToken && !envPassword) {
|
||||
return;
|
||||
}
|
||||
|
||||
const lines = [
|
||||
"- launchctl environment overrides detected (can cause confusing unauthorized errors).",
|
||||
@@ -122,7 +132,9 @@ export function noteDeprecatedLegacyEnvVars(
|
||||
(key.startsWith("MOLTBOT_") || key.startsWith("CLAWDBOT_")) && value?.trim(),
|
||||
)
|
||||
.map(([key]) => key);
|
||||
if (entries.length === 0) return;
|
||||
if (entries.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const lines = [
|
||||
"- Deprecated legacy environment variables detected (ignored).",
|
||||
|
||||
Reference in New Issue
Block a user