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

Function verifyPythonPath

apps/node/src/modules/utils/verify-python.ts:6–17  ·  view source on GitHub ↗
(pythonPath: string)

Source from the content-addressed store, hash-verified

4const execAsync = promisify(exec);
5
6export async function verifyPythonPath(pythonPath: string): Promise<boolean> {
7 try {
8 const { stdout, stderr } = await execAsync(`${pythonPath} --version`);
9 if (stderr) {
10 throw new Error(stderr)
11 }
12 console.log(`Python found: ${stdout}`);
13 return true;
14 } catch (error: any) {
15 throw new Error(`Python not found at ${pythonPath}`);
16 }
17}
18
19// verifyPythonPath("/Users/chenxuejia/comflowy/tmp/python");

Callers 1

ApiSetupConfigFunction · 0.90

Calls 1

logMethod · 0.80

Tested by

no test coverage detected