(comfy_path?: string)
| 81 | } |
| 82 | |
| 83 | export async function checkIfInstalledComfyUI(comfy_path?: string): Promise<boolean> { |
| 84 | try { |
| 85 | const comfyUIPath = comfy_path || getComfyUIDir(); |
| 86 | const isGitRepo = await fsExtra.exists(path.resolve(comfyUIPath, ".git")); |
| 87 | const isExistMain = await fsExtra.exists(path.resolve(comfyUIPath, "main.py")); |
| 88 | const isExisComfySrc = await fsExtra.exists(path.resolve(comfyUIPath, "comfy")); |
| 89 | return isGitRepo && isExistMain && isExisComfySrc; |
| 90 | } catch(err) { |
| 91 | return false; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | // 检查一个程序是否已经安装 |
| 96 | export async function checkIfInstalled(name: string): Promise<boolean> { |
no test coverage detected