Skip to content

Commit

Permalink
fix: hide links with no results in silent mode (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Nov 12, 2019
1 parent 9c3d184 commit 164a074
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,16 @@ async function main() {
return;
} else {
const parents = result.links.reduce((acc, curr) => {
const parent = curr.parent || '';
if (!acc[parent]) {
acc[parent] = [];
if (!flags.silent || curr.state === LinkState.BROKEN) {
const parent = curr.parent || '';
if (!acc[parent]) {
acc[parent] = [];
}
acc[parent].push(curr);
}
acc[parent].push(curr);
return acc;
}, {} as { [index: string]: LinkResult[] });

Object.keys(parents).forEach(parent => {
const links = parents[parent];
log(chalk.blue(parent));
Expand Down

0 comments on commit 164a074

Please sign in to comment.