2023-08-19 00:26:12 -04:00
|
|
|
#!/usr/bin/env -S deno run --unstable --allow-write --allow-read --allow-run --allow-net
|
2023-01-02 16:00:42 -05:00
|
|
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
2023-11-20 19:21:21 -05:00
|
|
|
import { join, ROOT_PATH } from "./util.js";
|
2020-11-05 09:53:21 -05:00
|
|
|
|
2023-01-13 13:42:15 -05:00
|
|
|
const subcommand = Deno.args.includes("--check") ? "check" : "fmt";
|
|
|
|
const configFile = join(ROOT_PATH, ".dprint.json");
|
2023-11-20 19:21:21 -05:00
|
|
|
const cmd = new Deno.Command("deno", {
|
|
|
|
args: [
|
|
|
|
"run",
|
|
|
|
"-A",
|
|
|
|
"--no-config",
|
|
|
|
"npm:dprint@0.43.0",
|
|
|
|
subcommand,
|
|
|
|
"--config=" + configFile,
|
|
|
|
],
|
2023-01-13 13:42:15 -05:00
|
|
|
cwd: ROOT_PATH,
|
|
|
|
stdout: "inherit",
|
|
|
|
stderr: "inherit",
|
|
|
|
});
|
|
|
|
|
|
|
|
const { code } = await cmd.output();
|
|
|
|
Deno.exit(code);
|