microsoft/typespec

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
6e5f5e24f68cb4e22b7eddde714f7969a1335cd7

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

30lines · modecode

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