Skip to content

Commit c50c6a1

Browse files
fix: change run command for Deno to prepend npm: prefix (#34)
Co-authored-by: Ben McCann <[email protected]>
1 parent 5af076e commit c50c6a1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/commands.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ function npmRun(agent: string) {
1111
}
1212
}
1313

14+
function denoRun() {
15+
return (args: string[]) => {
16+
return ['deno', 'run', `npm:${args[0]}`, ...args.slice(1)]
17+
}
18+
}
19+
1420
const npm: AgentCommands = {
1521
'agent': ['npm', 0],
1622
'run': npmRun('npm'),
@@ -87,7 +93,7 @@ const bun: AgentCommands = {
8793

8894
const deno: AgentCommands = {
8995
'agent': ['deno', 0],
90-
'run': ['deno', 'run', 0],
96+
'run': denoRun(),
9197
'install': ['deno', 'install', 0],
9298
'frozen': ['deno', 'install', '--frozen'],
9399
'global': ['deno', 'install', '-g', 0],

test/__snapshots__/command.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exports[`test deno run command > command handles args correctly 1`] = `
3737
{
3838
"args": [
3939
"run",
40-
"arg0",
40+
"npm:arg0",
4141
"arg1-0 arg1-1",
4242
],
4343
"command": "deno",

0 commit comments

Comments
 (0)