1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 17:49:08 -05:00
denoland-deno/format.ts

30 lines
633 B
TypeScript
Raw Normal View History

2019-05-06 17:07:43 -04:00
#!/usr/bin/env deno run --allow-run --allow-write --allow-read
2019-01-02 09:56:17 -05:00
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
const { exit, args, execPath } = Deno;
2019-01-26 23:19:56 -05:00
import { parse } from "./flags/mod.ts";
import { xrun } from "./prettier/util.ts";
2019-01-26 23:19:56 -05:00
2019-03-12 01:51:51 -04:00
async function main(opts): Promise<void> {
const args = [
execPath,
2019-05-04 11:33:50 -04:00
"run",
"--allow-write",
2019-02-09 15:41:05 -05:00
"--allow-read",
"prettier/main.ts",
"--ignore",
"node_modules",
"--ignore",
"testdata",
"--ignore",
"vendor"
];
if (opts.check) {
args.push("--check");
2019-01-26 23:19:56 -05:00
}
exit((await xrun({ args }).status()).code);
2018-12-18 18:56:12 -05:00
}
2019-01-26 23:19:56 -05:00
main(parse(args));