mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 02:42:54 +00:00
refactor: extract shared dedupe helpers for runtime paths
This commit is contained in:
@@ -64,3 +64,30 @@ export function evaluateEntryMetadataRequirementsForCurrentPlatform(
|
||||
localPlatform: process.platform,
|
||||
});
|
||||
}
|
||||
|
||||
export function evaluateEntryRequirementsForCurrentPlatform(params: {
|
||||
always: boolean;
|
||||
entry: {
|
||||
metadata?: (RequirementsMetadata & { emoji?: string; homepage?: string }) | null;
|
||||
frontmatter?: {
|
||||
emoji?: string;
|
||||
homepage?: string;
|
||||
website?: string;
|
||||
url?: string;
|
||||
} | null;
|
||||
};
|
||||
hasLocalBin: (bin: string) => boolean;
|
||||
remote?: RequirementRemote;
|
||||
isEnvSatisfied: (envName: string) => boolean;
|
||||
isConfigSatisfied: (pathStr: string) => boolean;
|
||||
}): ReturnType<typeof evaluateEntryMetadataRequirements> {
|
||||
return evaluateEntryMetadataRequirementsForCurrentPlatform({
|
||||
always: params.always,
|
||||
metadata: params.entry.metadata,
|
||||
frontmatter: params.entry.frontmatter,
|
||||
hasLocalBin: params.hasLocalBin,
|
||||
remote: params.remote,
|
||||
isEnvSatisfied: params.isEnvSatisfied,
|
||||
isConfigSatisfied: params.isConfigSatisfied,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user