mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 13:20:44 +00:00
refactor(update): extract package manager bootstrap logic
This commit is contained in:
@@ -40,9 +40,27 @@ export function inferUpdateFailureHints(result: UpdateRunResult): string[] {
|
||||
if (result.status !== "error") {
|
||||
return [];
|
||||
}
|
||||
if (result.reason === "required-manager-unavailable") {
|
||||
if (result.reason === "pnpm-corepack-missing") {
|
||||
return [
|
||||
"This checkout requires its declared package manager and the updater could not bootstrap it automatically.",
|
||||
"This pnpm checkout could not auto-enable pnpm because corepack is missing.",
|
||||
"Install pnpm manually or install Node with corepack available, then rerun the update command.",
|
||||
];
|
||||
}
|
||||
if (result.reason === "pnpm-corepack-enable-failed") {
|
||||
return [
|
||||
"This pnpm checkout could not auto-enable pnpm via corepack.",
|
||||
"Run `corepack enable` manually or install pnpm manually, then rerun the update command.",
|
||||
];
|
||||
}
|
||||
if (result.reason === "pnpm-npm-bootstrap-failed") {
|
||||
return [
|
||||
"This pnpm checkout could not bootstrap pnpm from npm automatically.",
|
||||
"Install pnpm manually, then rerun the update command.",
|
||||
];
|
||||
}
|
||||
if (result.reason === "preferred-manager-unavailable") {
|
||||
return [
|
||||
"This checkout requires its declared package manager and the updater could not find it.",
|
||||
"Install the missing package manager manually, then rerun the update command.",
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user