1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-13 16:26:08 -05:00
denoland-deno/cli/tests/lock_write_fetch.ts
Akshat Agarwal b8a5c29bf8
BREAKING CHANGE Rename Deno.run's args to cmd (#4444)
This is to avoid confusion with Deno.args which does not include the 
executable to be run.
2020-03-21 17:44:18 -04:00

44 lines
943 B
TypeScript

try {
Deno.removeSync("./lock_write_fetch.json");
} catch {}
const fetchProc = Deno.run({
stdout: "null",
stderr: "null",
cmd: [
Deno.execPath(),
"fetch",
"--reload",
"--lock=lock_write_fetch.json",
"--lock-write",
"https_import.ts"
]
});
const fetchCode = (await fetchProc.status()).code;
console.log(`fetch code: ${fetchCode}`);
const fetchCheckProc = Deno.run({
stdout: "null",
stderr: "null",
cmd: [
Deno.execPath(),
"fetch",
"--lock=lock_write_fetch.json",
"https_import.ts"
]
});
const fetchCheckProcCode = (await fetchCheckProc.status()).code;
console.log(`fetch check code: ${fetchCheckProcCode}`);
const runProc = Deno.run({
stdout: "null",
stderr: "null",
cmd: [Deno.execPath(), "--lock=lock_write_fetch.json", "https_import.ts"]
});
const runCode = (await runProc.status()).code;
console.log(`run code: ${runCode}`);
Deno.removeSync("./lock_write_fetch.json");