mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:10:43 +00:00
fix(catalog): preserve channel ClawHub specs
This commit is contained in:
@@ -9,16 +9,20 @@ export const OFFICIAL_CHANNEL_CATALOG_RELATIVE_PATH = "dist/channel-catalog.json
|
||||
|
||||
function toCatalogInstall(value, packageName) {
|
||||
const install = isRecord(value) ? value : {};
|
||||
const clawhubSpec = trimString(install.clawhubSpec);
|
||||
const npmSpec = trimString(install.npmSpec) || packageName;
|
||||
if (!npmSpec) {
|
||||
if (!clawhubSpec && !npmSpec) {
|
||||
return null;
|
||||
}
|
||||
const defaultChoice = trimString(install.defaultChoice);
|
||||
const minHostVersion = trimString(install.minHostVersion);
|
||||
const expectedIntegrity = trimString(install.expectedIntegrity);
|
||||
return {
|
||||
npmSpec,
|
||||
...(defaultChoice === "npm" || defaultChoice === "local" ? { defaultChoice } : {}),
|
||||
...(clawhubSpec ? { clawhubSpec } : {}),
|
||||
...(npmSpec ? { npmSpec } : {}),
|
||||
...(defaultChoice === "clawhub" || defaultChoice === "npm" || defaultChoice === "local"
|
||||
? { defaultChoice }
|
||||
: {}),
|
||||
...(minHostVersion ? { minHostVersion } : {}),
|
||||
...(expectedIntegrity ? { expectedIntegrity } : {}),
|
||||
...(install.allowInvalidConfigRecovery === true ? { allowInvalidConfigRecovery: true } : {}),
|
||||
|
||||
Reference in New Issue
Block a user