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

v8.0.1: program arguments not being passed to Mac's open program #231

Closed
ericmandel opened this issue Mar 2, 2021 · 3 comments · Fixed by #233
Closed

v8.0.1: program arguments not being passed to Mac's open program #231

ericmandel opened this issue Mar 2, 2021 · 3 comments · Fixed by #233

Comments

@ericmandel
Copy link
Contributor

The new {app: {name: "xxx", argument: "yyy"}} syntax doesn't appear to be passing arguments to the open program on a Mac.

Here is (correct) v7.4.1:

v7 4 1

Here is v8.0.1, with the arguments not passed ... perhaps I've got the syntax wrong??

v8 0 1

macOS: 10.15.7

@sindresorhus
Copy link
Owner

// @Richienb

@Richienb
Copy link
Contributor

Richienb commented Mar 3, 2021

arguments is actually an array of strings.

@ericmandel
Copy link
Contributor Author

@Richienb @sindresorhus Sorry, but this still does not work on a Mac, even with the correct calling sequence:

[~/tmp] eric% npm ls
tmp@ /Users/eric/tmp
└─┬ open@8.0.2
  ├── define-lazy-prop@2.0.0
  ├── is-docker@2.1.1
  └─┬ is-wsl@2.2.0
    └── is-docker@2.1.1 deduped

[~/tmp] eric% node
Welcome to Node.js v15.11.0.
Type ".help" for more information.

> const open = require('open');
undefined

> open('https://sindresorhus.com', {app: {name: 'google chrome', arguments: ['--incognito']}});
Promise {
  <ref *1> ChildProcess {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    _maxListeners: undefined,
    _closesNeeded: 3,
    _closesGot: 0,
    connected: false,
    signalCode: null,
    exitCode: null,
    killed: false,
    spawnfile: 'open',
    _handle: Process {
      onexit: [Function (anonymous)],
      pid: 27250,
      [Symbol(owner_symbol)]: [Circular *1]
    },
    spawnargs: [ 'open', '-a', 'google chrome', 'https://sindresorhus.com' ],
    pid: 27250,

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 a pull request may close this issue.

3 participants