-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: support PLAYWRIGHT_GLOBAL_INSTALL=1
env variable
#1470
Conversation
You can install playwright with ``` PLAYWRIGHT_GLOBAL_INSTALL=1 npm i playwright ``` to make it use a single shared location for all browser downloads. Fixes microsoft#1102
download-browser.js
Outdated
async function downloadBrowserWithProgressBar(downloadPath, browser, version = '') { | ||
async function downloadBrowserWithProgressBar(downloadPath, browser, respectGlobalInstall = false) { | ||
const PLAYWRIGHT_GLOBAL_INSTALL = respectGlobalInstall ? getFromENV('PLAYWRIGHT_GLOBAL_INSTALL') : false; | ||
if (!!PLAYWRIGHT_GLOBAL_INSTALL && PLAYWRIGHT_GLOBAL_INSTALL.toLowerCase().trim() !== 'false') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe respect 0 similar to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
download-browser.js
Outdated
const browserFetcher = require('./lib/server/browserFetcher.js'); | ||
const packageJSON = require('./package.json'); | ||
const envPaths = require('env-paths'); | ||
const appPaths = envPaths('playwright'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd inline to the callsite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…rosoft#1470)" In an offline discussion, we ended up not liking the way it is.
You can install playwright with
to make it use a single shared location for all browser
downloads.
Fixes #1102