* Attempts to locale the full executable path for Chrome/Chromium. * @return {string}
()
| 24 | * @return {string} |
| 25 | */ |
| 26 | function locateChromeExecutablePath() { |
| 27 | if (argv.executablePath) { |
| 28 | return argv.executablePath; |
| 29 | } |
| 30 | for (const executableBaseName of CHROME_BASENAMES) { |
| 31 | const executablePath = getStdout(`which ${executableBaseName}`).trim(); |
| 32 | if (executablePath) { |
| 33 | return executablePath; |
| 34 | } |
| 35 | } |
| 36 | throw new Error( |
| 37 | `Could not locate Chrome/Chromium executable. Make sure it is on your $PATH (looking for any of {${CHROME_BASENAMES.join(', ')}}) or pass --executablePath to amp visual-diff` |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Launches a Puppeteer controlled browser. |
no test coverage detected