From 08dc0d6788472521fa6863032d36cf99b101cb76 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 21 Nov 2021 15:09:42 +0100 Subject: [PATCH] scripts/list-deprecations: allow args to be passed to filter packages Signed-off-by: Patrik Oldsberg --- scripts/list-deprecations.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/list-deprecations.js b/scripts/list-deprecations.js index 4056ee8402..920b01c7b5 100755 --- a/scripts/list-deprecations.js +++ b/scripts/list-deprecations.js @@ -100,14 +100,19 @@ class ReleaseProvider { } async function main() { + let packageDirQueue = process.argv.slice(2); + const rootPath = resolvePath(__dirname, '..'); - const packageDirQueue = await Promise.all([ - fs.readdir(resolvePath(rootPath, 'packages')), - fs.readdir(resolvePath(rootPath, 'plugins')), - ]).then(([packages, plugins]) => [ - ...packages.map(dir => `packages/${dir}`), - ...plugins.map(dir => `plugins/${dir}`), - ]); + + if (packageDirQueue.length === 0) { + packageDirQueue = await Promise.all([ + fs.readdir(resolvePath(rootPath, 'packages')), + fs.readdir(resolvePath(rootPath, 'plugins')), + ]).then(([packages, plugins]) => [ + ...packages.map(dir => `packages/${dir}`), + ...plugins.map(dir => `plugins/${dir}`), + ]); + } const fileQueue = []; const deprecationQueue = [];