1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-12 10:37:52 -05:00
denoland-deno/tests/specs/permission/write_allow_binary/main.ts

15 lines
405 B
TypeScript
Raw Normal View History

const binaryName = Deno.build.os === "windows" ? "binary.exe" : "binary";
Deno.copyFileSync(Deno.execPath(), binaryName);
console.log("Running...");
const result = new Deno.Command(
Deno.execPath(),
{
args: ["run", "--allow-write", `--allow-run=./${binaryName}`, "sub.ts"],
stderr: "inherit",
stdout: "inherit",
},
).outputSync();
console.assert(result.code == 1, "Expected failure");