From d03a78cda46b34aadd600c0a1b4154b75cc5be3f Mon Sep 17 00:00:00 2001 From: realpavlvs Date: Mon, 7 Oct 2024 23:58:52 +0100 Subject: [PATCH] new: Fix global bin detection on windows. (#77) * vscode extension: Find globalPath on windows Update version to 0.13.1 issue #1673 * Correct lint error * Fix Formatting error --- packages/vscode-extension/package.json | 2 +- packages/vscode-extension/src/workspace.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/vscode-extension/package.json b/packages/vscode-extension/package.json index ece9e31..63ccf49 100644 --- a/packages/vscode-extension/package.json +++ b/packages/vscode-extension/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "0.13.0", + "version": "0.13.1", "name": "moon-console", "publisher": "moonrepo", "displayName": "moon console", diff --git a/packages/vscode-extension/src/workspace.ts b/packages/vscode-extension/src/workspace.ts index be81c8c..8f22e6d 100644 --- a/packages/vscode-extension/src/workspace.ts +++ b/packages/vscode-extension/src/workspace.ts @@ -176,7 +176,12 @@ export class Workspace { } try { - const globalBin = execa.sync('which', ['moon']).stdout; + let globalBin = ''; + if (process.platform === 'win32') { + globalBin = execa.sync('cmd', ['/c', 'where', 'moon']).stdout; + } else { + globalBin = execa.sync('which', ['moon']).stdout; + } if (globalBin && fs.existsSync(globalBin)) { return globalBin;