1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00
denoland-deno/tests/specs/permission/proc_self_fd/main.js
Matt Mastracci adc7b3de26
fix(runtime): Allow opening /dev/fd/XXX for unix (#23743)
`deno run script.ts <(some command)` is a valid use case -- let's allow
this to work without `--allow-all`.

Fixes #23703
2024-05-10 11:21:36 -06:00

18 lines
393 B
JavaScript

// This test is Linux/Darwin only
if (Deno.build.os !== "linux" && Deno.build.os !== "darwin") {
console.log("hi\n\n0");
Deno.exit(123);
}
const cmd = new Deno.Command("/usr/bin/env", {
args: [
"bash",
"-c",
[Deno.execPath(), "run", "--allow-read", "reader.ts", '<(echo "hi")'].join(
" ",
),
],
}).spawn();
console.log((await cmd.status).code);
Deno.exit(123);