Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: friendlier install failure message #5281

Merged
merged 1 commit into from
Feb 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ program
.command('install [browserType...]')
.description('Ensure browsers necessary for this version of Playwright are installed')
.action(function(browserType) {
const allBrowsers = new Set(['chromium', 'firefox', 'webkit']);
for (const type of browserType) {
if (!allBrowsers.has(type)) {
console.log(`Invalid browser name: '${type}'. Expecting 'chromium', 'firefox' or 'webkit'.`);
process.exit(1);
}
}
installBrowsers(browserType.length ? browserType : undefined).catch((e: any) => {
console.log(`Failed to install browsers\n${e}`);
process.exit(1);
Expand Down