2019-02-09 15:41:05 -05:00
|
|
|
#!/usr/bin/env deno --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.
|
2019-02-01 10:16:39 -05:00
|
|
|
import { exit, args } from "deno";
|
2019-01-26 23:19:56 -05:00
|
|
|
import { parse } from "./flags/mod.ts";
|
2019-02-01 10:16:39 -05:00
|
|
|
import { xrun, executableSuffix } from "./prettier/util.ts";
|
2019-01-26 23:19:56 -05:00
|
|
|
|
|
|
|
async function main(opts) {
|
2019-02-01 10:16:39 -05:00
|
|
|
const args = [
|
|
|
|
`deno${executableSuffix}`,
|
|
|
|
"--allow-write",
|
|
|
|
"--allow-run",
|
2019-02-09 15:41:05 -05:00
|
|
|
"--allow-read",
|
2019-02-01 10:16:39 -05:00
|
|
|
"prettier/main.ts",
|
|
|
|
"--ignore",
|
|
|
|
"testdata",
|
|
|
|
"--ignore",
|
|
|
|
"vendor"
|
|
|
|
];
|
|
|
|
|
|
|
|
if (opts.check) {
|
|
|
|
args.push("--check");
|
2019-01-26 23:19:56 -05:00
|
|
|
}
|
2019-02-01 10:16:39 -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));
|