mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 23:20:07 +00:00
Allow git describe formatted versions of node packs in workflows (#3518)
This commit is contained in:
@@ -36,6 +36,13 @@ export const useWorkflowPacks = (options: UseNodePacksOptions = {}) => {
|
||||
return undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean the version string to be used in the registry search.
|
||||
* Removes the leading 'v' and trims whitespace and line terminators.
|
||||
*/
|
||||
const cleanVersionString = (version: string) =>
|
||||
version.replace(/^v/, '').trim()
|
||||
|
||||
/**
|
||||
* Infer the pack for a node by searching the registry for packs that have nodes
|
||||
* with the same name.
|
||||
@@ -70,7 +77,9 @@ export const useWorkflowPacks = (options: UseNodePacksOptions = {}) => {
|
||||
if (packId === CORE_NODES_PACK_NAME) return undefined
|
||||
|
||||
const version =
|
||||
typeof node.properties.ver === 'string' ? node.properties.ver : undefined
|
||||
typeof node.properties.ver === 'string'
|
||||
? cleanVersionString(node.properties.ver)
|
||||
: undefined
|
||||
|
||||
return {
|
||||
id: packId,
|
||||
|
||||
Reference in New Issue
Block a user