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

Add executable check for local xdg-open #140

Merged
merged 2 commits into from Jun 29, 2019
Merged

Add executable check for local xdg-open #140

merged 2 commits into from Jun 29, 2019

Conversation

deansheather
Copy link
Contributor

Uses the executable package to ensure that the local/included xdg-open is executable. If it's not executable (or there was some other error checking if it was executable, for example ENOENT), it will fall back to system xdg-open instead.

This allows for use within environments where open thought it could run the bundled xdg-open but it actually can't, such as in binaries produced by a node.js binary compiler like nbin.

Inspired by #138 (comment).

@sindresorhus
Copy link
Owner

I would prefer using fs.access('file', fs.constants.X_OK)

@deansheather
Copy link
Contributor Author

@sindresorhus Updated the PR, could you review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants