mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-17 06:04:23 +01:00
Enabling npx command to install on Windows Desktop (#3283)
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user