Skip to content

Commit

Permalink
fixup! tools: notify user if format-md needs to be run
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Oct 30, 2021
1 parent 46d25dd commit 28d5dcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tools/lint-md/lint-md.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29339,8 +29339,10 @@ paths.forEach(async (path) => {
const fileContents = file.toString();
const result = await linter.process(file);
const isDifferent = fileContents !== result.toString();
if (format && isDifferent) {
fs.writeFileSync(path, result.toString());
if (format) {
if (isDifferent) {
fs.writeFileSync(path, result.toString());
}
} else {
if (isDifferent) {
process.exitCode = 1;
Expand Down
6 changes: 4 additions & 2 deletions tools/lint-md/lint-md.src.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ paths.forEach(async (path) => {
const fileContents = file.toString();
const result = await linter.process(file);
const isDifferent = fileContents !== result.toString();
if (format && isDifferent) {
fs.writeFileSync(path, result.toString());
if (format) {
if (isDifferent) {
fs.writeFileSync(path, result.toString());
}
} else {
if (isDifferent) {
process.exitCode = 1;
Expand Down

0 comments on commit 28d5dcc

Please sign in to comment.