From 7dac46b0bec62332b908f5d455a62c7ab44029a9 Mon Sep 17 00:00:00 2001 From: "bobo.yang" Date: Thu, 30 Nov 2023 08:13:26 +0800 Subject: [PATCH] first check workflow path --- src/contributes/commands.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/contributes/commands.ts b/src/contributes/commands.ts index bc897e7..cc77c58 100644 --- a/src/contributes/commands.ts +++ b/src/contributes/commands.ts @@ -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