Skip to content

Commit 73dc757

Browse files
authored
Merge pull request #388 from marp-team/silence-chrome-path-warning-if-used-edge
Prevent outputting a warning about CHROME_PATH if fallbacked to Edge
2 parents 75ffc5e + 0bf7041 commit 73dc757

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Fixed
6+
7+
- Prevent outputting a warning about `CHROME_PATH` env if fallbacked to Edge ([#388](https://github.com/marp-team/marp-cli/pull/388))
8+
59
## v1.4.0 - 2021-08-29
610

711
### Added

src/utils/puppeteer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ export const generatePuppeteerLaunchArgs = () => {
4242

4343
// Resolve Chrome path to execute
4444
if (executablePath === false) {
45+
let findChromeError: Error | undefined
46+
4547
if (process.env.IS_DOCKER) {
4648
// Use already known path within Marp CLI official Docker image
4749
executablePath = '/usr/bin/chromium-browser'
4850
} else {
4951
try {
5052
executablePath = findChromeInstallation()
5153
} catch (e) {
52-
if (e instanceof Error) warn(e.message)
54+
if (e instanceof Error) findChromeError = e
5355
}
5456
}
5557

@@ -58,6 +60,8 @@ export const generatePuppeteerLaunchArgs = () => {
5860
executablePath = findEdgeInstallation()
5961

6062
if (!executablePath) {
63+
if (findChromeError) warn(findChromeError.message)
64+
6165
error(
6266
'You have to install Google Chrome, Chromium, or Microsoft Edge to convert slide deck with current options.',
6367
CLIErrorCode.NOT_FOUND_CHROMIUM

0 commit comments

Comments
 (0)