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 app constants for popular apps #116
Comments
@IssueHunt has funded $40.00 to this issue.
|
I propose to treat () => {
if(isWsl) return ['Chrome'];
switch(process.platform){
case 'darwin': return 'google chrome canary';
case 'win32': return 'Chrome';
case 'linux': return ['google-chrome', 'google-chrome-stable', 'google-chrome-beta', 'google-chrome-dev'];
default: throw new Error('platform ${process.platform} not supported');
}
} Note (We can't provide Iterable without function, as in that case we won't be able to decide if |
@stroncium I do like your suggestion on it being just a function. I think the function should receive the Your proposal doesn't account for situations when the apps for different platforms require different arguments. How about we move from using an array to an object when app arguments are required? So instead of |
@sindresorhus Well that was my first idea, but I was thinking about making it full backward compatible here. Anyhow...
Do we want to handle |
Backwards-compatibility seems complicated. We can do a major version. I want:
|
Do we still want |
I guess it doesn't hurt to continue supporting it. We can remove it from the docs though and comment in the code that it should be removed at some point. |
In the example, Linux has 4 different binaries to call. How will the code detect which one to use? |
Those are different Chrome editions. They would have different constants. |
The first 2, |
I guess we'll have to open the most likely one and if it fails, try the second one. |
@sindresorhus has rewarded $36.00 to @richienb. See it on IssueHunt
|
Is it a typo to use Chrome Canary on macOS, while on other platforms it's just Chrome? |
It appears so. I'm on macOS 11.2.2 and |
App binaries have different names on different platforms. This complicates opening a certain app in a cross-platform manner. We could add some constants for popular apps:
https://github.com/sindresorhus/opn/blob/5c525b5f4f2472e35ace19d6df746bb355b8060a/test.js#L5-L17
Feedback welcome on how it should look like.
IssueHunt Summary
richienb has been rewarded.
Backers (Total: $40.00)
Submitted pull Requests
.apps
and allow multiple apps to be triedTips
The text was updated successfully, but these errors were encountered: