mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-10 08:02:53 +00:00
fix(cli): suppress self-update version warnings
This commit is contained in:
@@ -2750,6 +2750,7 @@ async function continuePostCoreUpdateInFreshProcess(params: {
|
||||
stdio: childStdio,
|
||||
env: {
|
||||
...stripGatewayServiceMarkerEnv(disableUpdatedPackageCompileCacheEnv(process.env)),
|
||||
OPENCLAW_UPDATE_IN_PROGRESS: "1",
|
||||
[POST_CORE_UPDATE_ENV]: "1",
|
||||
[POST_CORE_UPDATE_CHANNEL_ENV]: params.channel,
|
||||
...(params.requestedChannel
|
||||
@@ -2906,7 +2907,25 @@ async function markControlPlaneUpdateRestartSentinelFailureBestEffort(params: {
|
||||
}
|
||||
}
|
||||
|
||||
async function withUpdateInProgressEnv<T>(run: () => Promise<T>): Promise<T> {
|
||||
const previousUpdateInProgress = process.env.OPENCLAW_UPDATE_IN_PROGRESS;
|
||||
process.env.OPENCLAW_UPDATE_IN_PROGRESS = "1";
|
||||
return run().finally(() => {
|
||||
if (previousUpdateInProgress === undefined) {
|
||||
delete process.env.OPENCLAW_UPDATE_IN_PROGRESS;
|
||||
} else {
|
||||
process.env.OPENCLAW_UPDATE_IN_PROGRESS = previousUpdateInProgress;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
return await withUpdateInProgressEnv(async () => {
|
||||
await updateCommandInternal(opts);
|
||||
});
|
||||
}
|
||||
|
||||
async function updateCommandInternal(opts: UpdateCommandOptions): Promise<void> {
|
||||
suppressDeprecations();
|
||||
await cleanupStaleManagedServiceUpdateHandoffs().catch(() => undefined);
|
||||
const invocationCwd = tryResolveInvocationCwd();
|
||||
|
||||
Reference in New Issue
Block a user