2024-01-26 17:35:43 -05:00
|
|
|
#!/usr/bin/env -S deno run --allow-write --allow-read --allow-run --allow-net
|
2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 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",
|
2024-07-10 23:59:57 -04:00
|
|
|
"npm:dprint@0.47.2",
|
2023-11-20 19:21:21 -05:00
|
|
|
subcommand,
|
|
|
|
"--config=" + configFile,
|
|
|
|
],
|
2023-01-13 13:42:15 -05:00
|
|
|
cwd: ROOT_PATH,
|
2024-01-05 11:02:37 -05:00
|
|
|
stdout: "inherit",
|
2023-01-13 13:42:15 -05:00
|
|
|
stderr: "inherit",
|
|
|
|
});
|
|
|
|
|
2024-01-05 11:02:37 -05:00
|
|
|
const { code } = await cmd.output();
|
|
|
|
Deno.exit(code);
|