mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 17:39:57 +00:00
refactor(cli): extract deprecation guard to helper module
Move the Node v23+ process.noDeprecation try/catch guard into src/cli/update-cli/suppress-deprecations.ts so that update-cli.ts does not grow past the 1000-line size-guard threshold. No behavior change.
This commit is contained in:
@@ -62,6 +62,7 @@ import { formatCliCommand } from "./command-format.js";
|
||||
import { installCompletion } from "./completion-cli.js";
|
||||
import { runDaemonRestart } from "./daemon-cli.js";
|
||||
import { formatHelpExamples } from "./help-format.js";
|
||||
import { suppressDeprecations } from "./update-cli/suppress-deprecations.js";
|
||||
|
||||
export type UpdateCommandOptions = {
|
||||
json?: boolean;
|
||||
@@ -672,12 +673,7 @@ function printResult(result: UpdateRunResult, opts: PrintResultOptions) {
|
||||
}
|
||||
|
||||
export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
try {
|
||||
process.noDeprecation = true;
|
||||
} catch {
|
||||
/* read-only on Node v23+ */
|
||||
}
|
||||
process.env.NODE_NO_WARNINGS = "1";
|
||||
suppressDeprecations();
|
||||
const timeoutMs = opts.timeout ? Number.parseInt(opts.timeout, 10) * 1000 : undefined;
|
||||
const shouldRestart = opts.restart !== false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user