Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from mohit2agrawal/print-updated-dates
Browse files Browse the repository at this point in the history
issue#9 - print updated dates
  • Loading branch information
mcwhittemore committed Nov 29, 2017
2 parents ef616cf + b6bff13 commit 44da39f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,29 @@ opts.nonmembers = opts.nonmembers ? opts.nonmembers.split(',') : [];
missedIssues(opts)
.then(issues => {
var lastRepo = null;
var lastDate = null;
issues
.map(iss => {
iss.updated = iss.updated.slice(0,10);
return iss;
})
.sort((a, b) => {
if (a.repo === b.repo) return a.id - b.id;
if (a.repo === b.repo){
if (a.updated === b.updated)
return a.id - b.id;
return a.updated - b.updated;
}
return a.repo < b.repo ? -1 : 1;
})
.map(iss => {
if (lastRepo !== iss.repo) {
console.log(`${lastRepo === null ? '' : '\n'}## ${iss.repo}\n`); // eslint-disable-line no-console
lastRepo = iss.repo;
lastDate = null;
}
if (lastDate !== iss.updated){
console.log(`\n**${iss.updated}**\n`); // eslint-disable-line no-console
lastDate = iss.updated;
}
console.log(`- [ ] [#${iss.id} - ${iss.title}](${iss.url})`); // eslint-disable-line no-console
});
Expand Down

0 comments on commit 44da39f

Please sign in to comment.