1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00
denoland-deno/cli/tests/lock_write_fetch.ts
Bartek Iwańczuk a913b7a1ba
BREAKING: remove CLI 'deno script.ts' hack (#5026)
This PR removes the hack in CLI that allows to run scripts with shorthand: deno script.ts.

Removing this functionality because it hacks around short-comings of clap our CLI parser. We agree that this shorthand syntax is desirable, but it needs to be rethinked and reimplemented. For 1.0 we should go with conservative approach that is correct.
2020-05-04 13:03:30 +02:00

49 lines
976 B
TypeScript

try {
Deno.removeSync("./lock_write_fetch.json");
} catch {}
const fetchProc = Deno.run({
stdout: "null",
stderr: "null",
cmd: [
Deno.execPath(),
"cache",
"--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(),
"cache",
"--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(),
"run",
"--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");