mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-01 17:22:31 +00:00
fix(update): reject openclaw source package targets
This commit is contained in:
@@ -69,6 +69,7 @@ import {
|
||||
createGlobalInstallEnv,
|
||||
cleanupGlobalRenameDirs,
|
||||
globalInstallArgs,
|
||||
isOpenClawSourcePackageInstallSpec,
|
||||
resolveGlobalInstallTarget,
|
||||
resolveGlobalInstallSpec,
|
||||
resolvePnpmGlobalDirFromGlobalRoot,
|
||||
@@ -976,6 +977,14 @@ async function resolvePackageRuntimePreflightError(params: {
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
function formatUnsupportedOpenClawSourcePackageTargetMessage(target: string): string {
|
||||
return [
|
||||
`Unsupported package update target: ${target}.`,
|
||||
"OpenClaw package updates use published npm artifacts or built tarballs; npm GitHub source installs for openclaw/openclaw do not reliably produce an installable package.",
|
||||
"Use `openclaw update --channel dev` for the moving main checkout, or target `latest`, `beta`, an exact version, or a built `.tgz` package spec.",
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
async function resolvePackageRuntimeForPreflight(params: {
|
||||
nodeRunner?: string;
|
||||
timeoutMs?: number;
|
||||
@@ -3080,6 +3089,11 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
tag,
|
||||
env: process.env,
|
||||
});
|
||||
if (isOpenClawSourcePackageInstallSpec(packageInstallSpec)) {
|
||||
defaultRuntime.error(formatUnsupportedOpenClawSourcePackageTargetMessage(packageInstallSpec));
|
||||
defaultRuntime.exit(1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.dryRun) {
|
||||
|
||||
Reference in New Issue
Block a user