first check workflow path

This commit is contained in:
bobo.yang 2023-11-30 08:13:26 +08:00
parent 5eba10fe41
commit 7dac46b0be

View File

@ -285,13 +285,16 @@ export function registerInstallCommandsPython(context: vscode.ExtensionContext)
// 2. check requirements.txt in ~/.chat dir // 2. check requirements.txt in ~/.chat dir
// ~/.chat/requirements.txt // ~/.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)) {
requirementsFile = path.join(os.homedir(), '.chat', 'workflows', 'sys', 'requirements.txt');
if (!fs.existsSync(requirementsFile)) { if (!fs.existsSync(requirementsFile)) {
logger.channel()?.warn(`requirements.txt not found in ~/.chat/workflows dir.`); logger.channel()?.warn(`requirements.txt not found in ~/.chat/workflows dir.`);
logger.channel()?.show(); logger.channel()?.show();
vscode.window.showErrorMessage(`Error: see OUTPUT for more detail!`); vscode.window.showErrorMessage(`Error: see OUTPUT for more detail!`);
return ; return ;
} }
}
// 3. install requirements.txt // 3. install requirements.txt
// run command: pip install -r {requirementsFile} // run command: pip install -r {requirementsFile}