Merge pull request #345 from devchat-ai/fix_workflow_requirements_path

check requirements.txt in workflows/sys
This commit is contained in:
boob.yang 2023-11-30 08:18:25 +08:00 committed by GitHub
commit 8a055e378f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,12 +285,15 @@ export function registerInstallCommandsPython(context: vscode.ExtensionContext)
// 2. check requirements.txt in ~/.chat dir
// ~/.chat/requirements.txt
const requirementsFile = path.join(os.homedir(), '.chat', "workflows", 'requirements.txt');
let requirementsFile = path.join(os.homedir(), '.chat', 'workflows', 'requirements.txt');
if (!fs.existsSync(requirementsFile)) {
logger.channel()?.warn(`requirements.txt not found in ~/.chat/workflows dir.`);
logger.channel()?.show();
vscode.window.showErrorMessage(`Error: see OUTPUT for more detail!`);
return ;
requirementsFile = path.join(os.homedir(), '.chat', 'workflows', 'sys', 'requirements.txt');
if (!fs.existsSync(requirementsFile)) {
logger.channel()?.warn(`requirements.txt not found in ~/.chat/workflows dir.`);
logger.channel()?.show();
vscode.window.showErrorMessage(`Error: see OUTPUT for more detail!`);
return ;
}
}
// 3. install requirements.txt