Skip to content

Commit

Permalink
Fix bug with issue duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
burkov committed Feb 13, 2020
1 parent a198156 commit 8bb3057
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const dayjs = require('dayjs');
const Ora = require('ora');

let accessToken;
program.version('1.4.0');
program.version('1.4.2');
program.name('branch-status');
program.arguments('<token>');
program.option('--skip-released', `don't show issues in Released state`, false);
Expand Down Expand Up @@ -88,11 +88,11 @@ const main = async () => {
logError('Failed to run git branch', code);
}

const issues = stdout
const issues = [ ...new Set(stdout
.split('\n')
.flatMap((line) => line.match(/\w{2,4}-\d{1,6}/ig) || [])
.filter((issueId) => (program.issuePrefix === undefined) || (RegExp(program.issuePrefix, 'i').test(issueId)))
.map((x) => x.toUpperCase());
.map((x) => x.toUpperCase())) ];

console.log(chalk.green(`Fetching YT issue statuses for ${issues.length} branches...`));
program.sort = !program.noSort;
Expand Down

0 comments on commit 8bb3057

Please sign in to comment.