Skip to content

Commit fd46ffb

Browse files
authored
feature: Show message for windows instance (#80)
1 parent 1a0c445 commit fd46ffb

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
{
5555
"id": "codacy:cli",
5656
"name": "Codacy CLI",
57-
"when": "codacy:hasProject && !codacy:cliInstalled && codacy:canInstallCLI",
57+
"when": "codacy:hasProject && ((!codacy:cliInstalled && codacy:canInstallCLI) || codacy:windowsDetected)",
5858
"icon": "$(gear)",
5959
"initialSize": 2
6060
},
@@ -127,7 +127,12 @@
127127
{
128128
"view": "codacy:cli",
129129
"contents": "Install Codacy CLI to analyze your code locally\n[Install Codacy CLI](command:codacy.installCLI)",
130-
"when": "!codacy:cliInstalled && codacy:canInstallCLI && !codacy:cliInstalling"
130+
"when": "!codacy:cliInstalled && codacy:canInstallCLI && !codacy:cliInstalling "
131+
},
132+
{
133+
"view": "codacy:cli",
134+
"contents": "Codacy CLI is only available on Windows via WSL. Make sure you install the WSL extension and start a WSL window.",
135+
"when": "codacy:windowsDetected"
131136
},
132137
{
133138
"view": "codacy:cli",

src/extension.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ export async function activate(context: vscode.ExtensionContext) {
126126
os.platform() === 'darwin' || os.platform() === 'linux'
127127
)
128128

129+
await vscode.commands.executeCommand('setContext', 'codacy:windowsDetected', os.platform() === 'win32')
130+
129131
// Set isGitRepository to false by default, will be updated by git provider logic
130132
await vscode.commands.executeCommand('setContext', 'codacy:isGitRepository', false)
131133

0 commit comments

Comments
 (0)