microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
ce9c567e5bfb441bb6415699a6b6fa797bc08f2e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

eng/scripts/check-for-changed-files.js

31lines · modecode

1// @ts-check
2import { run } from "./legacy-helpers.js";
3
4const proc = run("git", ["status", "--porcelain"], {
5 encoding: "utf-8",
6 stdio: [null, "pipe", "pipe"],
7});
8
9if (proc.stdout) {
10 console.log(proc.stdout);
11}
12
13if (proc.stderr) {
14 console.error(proc.stderr);
15}
16
17if (proc.stdout || proc.stderr) {
18 if (process.argv[2] !== "publish") {
19 console.error(
20 `ERROR: Files above were changed during PR validation, but not included in the PR.
21Include any automated changes such as sample output, spec.html, and ThirdPartyNotices.txt in your PR.`
22 );
23 } else {
24 console.error(
25 `ERROR: Changes have been made since this publish PR was prepared.
26In the future, remember to alert coworkers to avoid merging additional changes while publish PRs are in progress.
27Close this PR, run prepare-publish again.`
28 );
29 }
30 process.exit(1);
31}
32