diff --git a/src/util/python_installer/install_devchat.ts b/src/util/python_installer/install_devchat.ts index d3faa57..c5dc094 100644 --- a/src/util/python_installer/install_devchat.ts +++ b/src/util/python_installer/install_devchat.ts @@ -36,11 +36,18 @@ export async function installDevchat(): Promise { const pythonApp = path.join(pythonTargetPath, "python.exe"); const pythonPathFile = path.join(pythonTargetPath, "python311._pth"); const sitepackagesPath = path.join(UiUtilWrapper.extensionPath(), "tools", "site-packages"); + + const userHomeDir = os.homedir(); + // TODO: temperary workflow base dir name, need to change + const WORKFLOWS_BASE_NAME = "new_wf"; + const workflow_base_path = path.join(userHomeDir, ".chat", WORKFLOWS_BASE_NAME); + + const new_python_path = [workflow_base_path, sitepackagesPath].join("\n"); // read content in pythonPathFile let content = fs.readFileSync(pythonPathFile, { encoding: 'utf-8' }); // replace %PYTHONPATH% with sitepackagesPath - content = content.replace(/%PYTHONPATH%/g, sitepackagesPath); + content = content.replace(/%PYTHONPATH%/g, new_python_path); // write content to pythonPathFile fs.writeFileSync(pythonPathFile, content);