Skip to content

Commit

Permalink
fix: Escape id argument in resolveDeno
Browse files Browse the repository at this point in the history
  • Loading branch information
skeithtan committed Dec 11, 2024
1 parent 9f6c6fe commit c1a7aee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/resolver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { exec } from "node:child_process";
import { execFile } from "node:child_process";
import process from "node:process";
import { fileURLToPath } from "node:url";
import { execAsync } from "./utils.js";
Expand Down Expand Up @@ -78,11 +78,11 @@ export async function resolveDeno(
// cache directory. The `deno info` command reveals that information
// though, so we can use that.
const output = await new Promise<string | null>((resolve) => {
exec(`${DENO_BINARY} info --json ${id}`, { cwd }, (error, stdout) => {
if (error) resolve(null);
else resolve(stdout);
});
execFile(DENO_BINARY, ['info', '--json', id], { cwd }, (error, stdout) => {
if (error) resolve(null);
else resolve(stdout);
});
});

if (output === null) return null;

Expand Down

0 comments on commit c1a7aee

Please sign in to comment.