oclif/cli-ux

On Linux open() fails

l0rd opened this issue · 0 comments

l0rd commented

When process.platform === 'linux' the following code

import { cli } from 'cli-ux'
await cli.open('https://github.com')

fails with error Error: spawn /my/project/dir/node_modules/cli-ux/lib/xdg-open ENOENT

I suspect this line to be the problem https://github.com/oclif/cli-ux/blob/master/src/open.ts#L56

If I add the option { app: 'xdg-open' } it works fine:

import { cli } from 'cli-ux'
await cli.open('https://github.com',{ app: 'xdg-open' } )