0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-30 09:08:00 -04:00
denoland-deno/format.ts
Yoshiya Hinosawa 0eb1a49b38 Add reusable prettier wrapper CLI (denoland/deno_std#165)
This also fixes an issue with the path on azure-pipelines.

Original: e7837ff0f0
2019-02-01 10:16:39 -05:00

26 lines
584 B
TypeScript
Executable file

#!/usr/bin/env deno --allow-run --allow-write
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { exit, args } from "deno";
import { parse } from "./flags/mod.ts";
import { xrun, executableSuffix } from "./prettier/util.ts";
async function main(opts) {
const args = [
`deno${executableSuffix}`,
"--allow-write",
"--allow-run",
"prettier/main.ts",
"--ignore",
"testdata",
"--ignore",
"vendor"
];
if (opts.check) {
args.push("--check");
}
exit((await xrun({ args }).status()).code);
}
main(parse(args));