Open jennifer-shehane opened 4 years ago
If you only want it for macOS, why not just cal open -R
directly? You don't need this package then.
We're supporting all OS's and only want to send the -R
when it's 'darwin' just because it's a nicer experience to highlight the file if we can.
Maybe the example wasn't very clear. We're actually doing the below where we patched the package to allow passing an opts.args
argument then this is being used throughout our repo. But I hate having to fork our own patch for this.
const os = require('os')
const open = require('open')
module.exports = {
open (arg, opts = {}) {
if (os.platform() === 'darwin') {
opts.args = '-R'
}
return open(arg, opts)
},
}
So what do you do on non-macOS systems? Just open the file? If so, kinda weird to have such different behavior depending on which system it is. Just a thought.
But yes, I'm open to adding an option for this. It needs a good name though.
Yeah, it just opens the file.
We want the ability to pass our own flags to open, specifically the
-R
flag if we detect it is ondarwin
os. https://github.com/sindresorhus/open/issues/175Can you allow passing along flags to open as part of the options?