2024-10-02 20:17:39 +00:00
|
|
|
#!/usr/bin/env -S deno run --allow-all --config=tests/config/deno.json
|
2024-01-01 19:58:21 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-11-21 00:21:21 +00:00
|
|
|
import { join, ROOT_PATH } from "./util.js";
|
2020-11-05 14:53:21 +00:00
|
|
|
|
2023-01-13 18:42:15 +00:00
|
|
|
const subcommand = Deno.args.includes("--check") ? "check" : "fmt";
|
|
|
|
const configFile = join(ROOT_PATH, ".dprint.json");
|
2023-11-21 00:21:21 +00:00
|
|
|
const cmd = new Deno.Command("deno", {
|
|
|
|
args: [
|
|
|
|
"run",
|
|
|
|
"-A",
|
|
|
|
"--no-config",
|
2024-07-11 03:59:57 +00:00
|
|
|
"npm:dprint@0.47.2",
|
2023-11-21 00:21:21 +00:00
|
|
|
subcommand,
|
|
|
|
"--config=" + configFile,
|
|
|
|
],
|
2023-01-13 18:42:15 +00:00
|
|
|
cwd: ROOT_PATH,
|
2024-01-05 16:02:37 +00:00
|
|
|
stdout: "inherit",
|
2023-01-13 18:42:15 +00:00
|
|
|
stderr: "inherit",
|
|
|
|
});
|
|
|
|
|
2024-01-05 16:02:37 +00:00
|
|
|
const { code } = await cmd.output();
|
|
|
|
Deno.exit(code);
|