MCPcopy Create free account
hub / github.com/6174/comflowyspace / installCondaPackageTask

Function installCondaPackageTask

apps/node/src/modules/comfyui/bootstrap.ts:222–249  ·  view source on GitHub ↗
(dispatcher: TaskEventDispatcher, params: {
    packageRequirment: string
})

Source from the content-addressed store, hash-verified

220 * @returns
221 */
222export async function installCondaPackageTask(dispatcher: TaskEventDispatcher, params: {
223 packageRequirment: string
224}): Promise<boolean> {
225 let success = false;
226 let lastError = null;
227
228 for (let i = 0; i < 3; i++) {
229 try {
230 dispatcher({
231 message: `Start installing ${params.packageRequirment}...`
232 });
233 await runCommand(`conda install -c anaconda -n ${CONDA_ENV_NAME} ${params.packageRequirment} -y`, dispatcher);
234 dispatcher({
235 message: `Install ${params.packageRequirment} end`
236 });
237 success = true;
238 break;
239 } catch(e: any) {
240 lastError = e
241 }
242 }
243
244 if (!success) {
245 new Error(`Install conda packages error: ${lastError.message}`)
246 }
247
248 return true;
249}
250
251
252/**

Callers 1

ApiBootstrapFunction · 0.90

Calls 1

runCommandFunction · 0.90

Tested by

no test coverage detected