Merge pull request #179 from covespace/log_devchat_fail_reason

Log devchat fail reason
This commit is contained in:
boob.yang 2023-06-12 08:44:33 +08:00 committed by GitHub
commit 427f27c97a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 27 deletions

View File

@ -1,6 +1,7 @@
// src/contributes/commandsBase.ts // src/contributes/commandsBase.ts
import { runCommand } from "../util/commonUtil"; import { runCommand } from "../util/commonUtil";
import { logger } from "../util/logger";
export function checkDevChatDependency(): boolean { export function checkDevChatDependency(): boolean {
@ -14,10 +15,15 @@ export function checkDevChatDependency(): boolean {
runCommand('devchat --help'); runCommand('devchat --help');
return true; return true;
} else { } else {
logger.channel()?.error(`Failed to get pipx environment path, I will try to install pipx.`);
logger.channel()?.show();
return false; return false;
} }
} catch (error) { } catch (error) {
// DevChat dependency check failed // DevChat dependency check failed
// log out detail error message
logger.channel()?.error(`Failed to check DevChat dependency: ${error}`);
logger.channel()?.show();
return false; return false;
} }
} }

View File

@ -62,7 +62,7 @@ export async function dependencyCheck(): Promise<[string, string]> {
} }
if (devchatStatus === 'not ready') { if (devchatStatus === 'not ready') {
// auto install devchat // auto install devchat
UiUtilWrapper.runTerminal('DevChat Install', `python ${UiUtilWrapper.extensionPath() + "/tools/install.py"}`); UiUtilWrapper.runTerminal('DevChat Install', `python3 ${UiUtilWrapper.extensionPath() + "/tools/install.py"}`);
devchatStatus = 'waiting install devchat'; devchatStatus = 'waiting install devchat';
isVersionChangeCompare = true; isVersionChangeCompare = true;
} }