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

@deansheather deansheather commented Jun 5, 2019

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

@sindresorhus sindresorhus commented Jun 12, 2019

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

@deansheather
Copy link
Contributor Author

@deansheather deansheather commented Jun 27, 2019

@sindresorhus Updated the PR, could you review?

@sindresorhus sindresorhus merged commit 78fcc9e into sindresorhus:master Jun 29, 2019
1 check passed
1 check passed
@travis-ci
Travis CI - Pull Request Build Passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants