mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 08:41:41 +00:00
feat(skills): add cross-platform install fallback for non-brew environments (#17687)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 3ed4850838
Co-authored-by: mcrolly <60803337+mcrolly@users.noreply.github.com>
Co-authored-by: sebslight <19554889+sebslight@users.noreply.github.com>
Reviewed-by: @sebslight
This commit is contained in:
@@ -74,7 +74,9 @@ function selectPreferredInstallSpec(
|
||||
const goSpec = findKind("go");
|
||||
const uvSpec = findKind("uv");
|
||||
|
||||
if (prefs.preferBrew && hasBinary("brew") && brewSpec) {
|
||||
const brewAvailable = hasBinary("brew");
|
||||
|
||||
if (prefs.preferBrew && brewAvailable && brewSpec) {
|
||||
return brewSpec;
|
||||
}
|
||||
if (uvSpec) {
|
||||
@@ -83,12 +85,25 @@ function selectPreferredInstallSpec(
|
||||
if (nodeSpec) {
|
||||
return nodeSpec;
|
||||
}
|
||||
if (brewSpec) {
|
||||
// Only prefer brew when it is actually installed; otherwise skip to
|
||||
// alternatives so Linux/Docker environments without brew get a working
|
||||
// install option instead of a guaranteed failure.
|
||||
if (brewSpec && brewAvailable) {
|
||||
return brewSpec;
|
||||
}
|
||||
if (goSpec) {
|
||||
return goSpec;
|
||||
}
|
||||
// Prefer download over an unavailable brew spec.
|
||||
const downloadSpec = findKind("download");
|
||||
if (downloadSpec) {
|
||||
return downloadSpec;
|
||||
}
|
||||
// Last resort: return brew spec even without brew so the caller can
|
||||
// surface a descriptive error rather than "no installer found".
|
||||
if (brewSpec) {
|
||||
return brewSpec;
|
||||
}
|
||||
return indexed[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user