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,12 +285,15 @@ 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)) { if (!fs.existsSync(requirementsFile)) {
logger.channel()?.warn(`requirements.txt not found in ~/.chat/workflows dir.`); requirementsFile = path.join(os.homedir(), '.chat', 'workflows', 'sys', 'requirements.txt');
logger.channel()?.show(); if (!fs.existsSync(requirementsFile)) {
vscode.window.showErrorMessage(`Error: see OUTPUT for more detail!`); logger.channel()?.warn(`requirements.txt not found in ~/.chat/workflows dir.`);
return ; logger.channel()?.show();
vscode.window.showErrorMessage(`Error: see OUTPUT for more detail!`);
return ;
}
} }
// 3. install requirements.txt // 3. install requirements.txt