mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
15 lines
405 B
TypeScript
15 lines
405 B
TypeScript
|
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");
|