Enabling npx command to install on Windows Desktop (#3283)

This commit is contained in:
Rizel Scarlett
2025-07-07 16:29:14 -04:00
committed by GitHub
parent a2081e6594
commit c12f02bb82
3 changed files with 3 additions and 2 deletions

View File

@@ -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',

View File

@@ -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));

View File

@@ -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]) {