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

macOS: Auto detection of executable path when CHROME_PATH has pointed .app folder #460

Closed
yhatt opened this issue Jun 25, 2022 · 0 comments · Fixed by #463
Closed

macOS: Auto detection of executable path when CHROME_PATH has pointed .app folder #460

yhatt opened this issue Jun 25, 2022 · 0 comments · Fixed by #463
Labels
enhancement New feature or request

Comments

@yhatt
Copy link
Member

yhatt commented Jun 25, 2022

For setting custom Chrome path, CHROME_PATH environment value requires the path for an executable binary.

In macOS, a common mistake is setting the path for the app /Applications/Google Chrome.app. xxx.app is actually a special directory, not an executable file. A user should set /Applications/Google Chrome.app/Contents/MacOS/Google Chrome instead.

Having said that, the detail of .app is hidden to OS users unless an explicit action. It's natural to think users that setting /Applications/Google Chrome.app is working well.

So it's helpful to provide auto-detection of executable path for macOS when filled all following conditions:

  • os.platform() is 'darwin'.
  • CHROME_PATH env has been set a string that has an ending .app + optional trailing slash.
  • (await fsPromise.stat(env.CHROME_PATH)).isDirectory() is true.

For example, /foo/bar/ABCDEF.app will resolve as /foo/bar/ABCDEF.app/Contents/MacOS/ABCDEF.

We may have to check ./Contents/Info.plist to detect whether CFBundlePackageType is AAPL for more strict detection.

@yhatt yhatt added the enhancement New feature or request label Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant