From 040d81052a2ff81bb0e74a42bacef1473a7aa5eb Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Fri, 2 Jul 2021 11:22:26 -0700 Subject: [PATCH] fix(cli): do not suggest internal tools in `install` command (#7437) --- src/cli/cli.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cli/cli.ts b/src/cli/cli.ts index d600a9269a..cf8cc65758 100755 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -39,6 +39,7 @@ const SCRIPTS_DIRECTORY = path.join(__dirname, '..', '..', 'bin'); type BrowserChannel = 'chrome-beta'|'chrome'|'msedge'; const allBrowserChannels: Set = new Set(['chrome-beta', 'chrome', 'msedge']); +const suggestedBrowsersToInstall = ['chromium', 'webkit', 'firefox', ...allBrowserChannels].map(name => `'${name}'`).join(', '); const packageJSON = require('../../package.json'); const ChannelName = { @@ -125,7 +126,7 @@ program const browserChannels: Set = new Set(args.filter((browser: any) => allBrowserChannels.has(browser))); const faultyArguments: string[] = args.filter((browser: any) => !browserNames.has(browser) && !browserChannels.has(browser)); if (faultyArguments.length) { - console.log(`Invalid installation targets: ${faultyArguments.map(name => `'${name}'`).join(', ')}. Expecting one of: ${[...allBrowserNames, ...allBrowserChannels].map(name => `'${name}'`).join(', ')}`); + console.log(`Invalid installation targets: ${faultyArguments.map(name => `'${name}'`).join(', ')}. Expecting one of: ${suggestedBrowsersToInstall}`); process.exit(1); } if (browserNames.has('chromium') || browserChannels.has('chrome-beta') || browserChannels.has('chrome') || browserChannels.has('msedge')) @@ -145,7 +146,7 @@ program console.log(` Install default browsers.`); console.log(``); console.log(` - $ install chrome firefox`); - console.log(` Install custom browsers, supports ${[...allBrowserNames, ...allBrowserChannels].map(name => `'${name}'`).join(', ')}.`); + console.log(` Install custom browsers, supports ${suggestedBrowsersToInstall}.`); }); async function installBrowserChannel(channel: BrowserChannel) {