Skip to content

Commit 3a08a7a

Browse files
committed
feat(format): output which files are (un)changed
1 parent f61bde4 commit 3a08a7a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/format.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,14 @@ export const run = async (program: CommanderApi) => {
7373

7474
await Promise.all(
7575
pkgs.map(({ data, path }) => {
76-
console.log(chalk.blue(`./${relative('.', path)}`));
7776
const nextData = sortManifest(shortenBugs(shortenRepository(data)));
78-
return writeJson(path, nextData, { spaces: indent });
77+
const hasChanged = JSON.stringify(nextData) !== JSON.stringify(data);
78+
const shortPath = `./${relative('.', path)}`;
79+
if (hasChanged) {
80+
console.log(chalk.bgYellow.black(' FIXED '), chalk.blue(shortPath));
81+
return writeJson(path, nextData, { spaces: indent });
82+
}
83+
console.log(chalk.bgGreen.black(' VALID '), chalk.blue(shortPath));
7984
})
8085
);
8186
};

0 commit comments

Comments
 (0)