From c12f02bb82b4c6761aba3ec61485036b8f79bd0c Mon Sep 17 00:00:00 2001 From: Rizel Scarlett Date: Mon, 7 Jul 2025 16:29:14 -0400 Subject: [PATCH] Enabling npx command to install on Windows Desktop (#3283) --- ui/desktop/src/components/settings/extensions/deeplink.ts | 2 +- ui/desktop/src/components/settings/extensions/utils.ts | 2 +- ui/desktop/src/extensions.tsx | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/desktop/src/components/settings/extensions/deeplink.ts b/ui/desktop/src/components/settings/extensions/deeplink.ts index 5c43ca59..41e6f57c 100644 --- a/ui/desktop/src/components/settings/extensions/deeplink.ts +++ b/ui/desktop/src/components/settings/extensions/deeplink.ts @@ -14,7 +14,7 @@ function getStdioConfig( timeout: number ) { // Validate that the command is one of the allowed commands - const allowedCommands = ['cu', 'docker', 'jbang', 'npx', 'uvx', 'goosed']; + const allowedCommands = ['cu', 'docker', 'jbang', 'npx', 'uvx', 'goosed', 'npx.cmd']; if (!allowedCommands.includes(cmd)) { toastService.handleError( 'Invalid Command', diff --git a/ui/desktop/src/components/settings/extensions/utils.ts b/ui/desktop/src/components/settings/extensions/utils.ts index 53cf1420..66aa7409 100644 --- a/ui/desktop/src/components/settings/extensions/utils.ts +++ b/ui/desktop/src/components/settings/extensions/utils.ts @@ -213,7 +213,7 @@ export async function replaceWithShims(cmd: string) { export function removeShims(cmd: string) { // Only remove shims if the path matches our known shim patterns - const shimPatterns = [/cu$/, /goosed$/, /docker$/, /jbang$/, /npx$/, /uvx$/]; + const shimPatterns = [/cu$/, /goosed$/, /docker$/, /jbang$/, /npx$/, /uvx$/, /npx.cmd$/]; // Check if the command matches any shim pattern const isShim = shimPatterns.some((pattern) => pattern.test(cmd)); diff --git a/ui/desktop/src/extensions.tsx b/ui/desktop/src/extensions.tsx index 598fee62..2d12b3fb 100644 --- a/ui/desktop/src/extensions.tsx +++ b/ui/desktop/src/extensions.tsx @@ -275,6 +275,7 @@ export async function replaceWithShims(cmd: string) { jbang: await window.electron.getBinaryPath('jbang'), npx: await window.electron.getBinaryPath('npx'), uvx: await window.electron.getBinaryPath('uvx'), + 'npx.cmd': await window.electron.getBinaryPath('npx.cmd'), }; if (binaryPathMap[cmd]) {