From d236d9db5382f8f98dcc143fad398e708d220058 Mon Sep 17 00:00:00 2001 From: "alexander.burkov" Date: Mon, 10 Feb 2020 23:55:43 +0300 Subject: [PATCH] fix bug with regexp --- src/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index d8833cb..52e7c66 100644 --- a/src/index.js +++ b/src/index.js @@ -89,11 +89,8 @@ const main = async () => { const issues = stdout .split('\n') - .map((l) => { - let result = /(JPF-[0-9]+)/.exec(l); - return result ? result[1] : undefined; - }) - .filter((e) => e !== undefined); + .flatMap((line) => line.match(/jpf-\d{1,6}/ig) || []) + .map((x) => x.toUpperCase()); console.log(chalk.green(`Fetching YT issue statuses for ${issues.length} branches...`)); program.sort = !program.noSort;