Skip to content

Commit

Permalink
Better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
badsyntax committed Dec 19, 2022
1 parent 3732cfe commit 5f9a1b7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/core/Utilities/LocalTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ export type LocalTool = {

export class LocalTools {
public static getInstalledLocalTools(rootPath: string): LocalTool[] {
let buffer = execSync('dotnet tool list --local', {
cwd: rootPath
});
let buffer: Buffer;
try {
buffer = execSync('dotnet tool list --local', {
cwd: rootPath
});
} catch {
return [];
}

if (!buffer) {
return [];
}
Expand Down

0 comments on commit 5f9a1b7

Please sign in to comment.