Files
babel/scripts/assert-dir-git-clean.js
T
Huáng JùnliàngandGitHub 254525d565 Enforce node protocol import (#17207)
* enable prefer-node-protocol rule

* prefer node protocol import

* fix broken scripts

* fix e2e-old-babel error

* strip node: protocol for old node versions

* update Makefile.mjs
2025-03-31 10:49:22 -04:00

21 lines
519 B
JavaScript

// Must run at a git working dir
import { execSync } from "node:child_process";
const fixCommand = process.argv[2];
if (execSync("git status --porcelain=v1", { encoding: "utf8" })) {
console.log(
`Please re-run "${fixCommand}" and checkout the following changes to git`
);
execSync("git status", { stdio: "inherit" });
if (process.env.GITHUB_ACTIONS) {
console.log("::group::git diff");
execSync("git diff", { stdio: "inherit" });
console.log("::endgroup::");
}
process.exitCode = 1;
}