max-mapper / monu

menubar process monitor mac app [ALPHA]
https://github.com/maxogden/monu/releases
BSD 2-Clause "Simplified" License
1.11k stars 74 forks source link

load PATH of mac user #4

Closed max-mapper closed 9 years ago

max-mapper commented 9 years ago

when you run atom-shell index.js you can do e.g. require('child_process').exec('foo') and if foo is in your PATH it will find it.

but when you run it by double clicking Monu.app it says 'command not found: foo'. gotta figure this out :(

balupton commented 9 years ago

bevry/safeps comes to the rescue here, you can use safeps.getExecPath('foo', (err,path){}) then use safeps.exec, or just use safeps.spawn which will do the execPath thing automatically.

Usage examples: https://github.com/bevry/safeps/blob/master/src/test/safeps-test.coffee