Skip to content

shell.which returns object #933

@chrispahm

Description

@chrispahm

Node version (or tell us if you're using electron or some other framework):

Using Shell.js in an Atom (1.34) plugin, => Electron 2.0.12

ShellJS version (the most recent version/Github branch you see the bug on):

0.8.3

Operating system:

macOS

Description of the bug:

shell.which('command') returns an object instead of a string

Example ShellJS command to reproduce the error:

const test = shell.which('git')
console.log(typeof test) // yields 'object' instead of 'string'

Current workaround (hack) until fix is available

let test = shell.which('git')
if (test) {
  test = JSON.parse(JSON.stringify(test))
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions