Get the
$PATH
from the shell
Useful for Electron/NW.js apps as GUI apps on OS X doesn't inherit the $PATH
defined in your dotfiles (.bashrc/.bash_profile/.zshrc/etc).
$ npm install --save shell-path
When executed from a GUI app on OS X:
const shellPath = require('shell-path');
console.log(process.env.PATH);
//=> '/usr/bin'
console.log(shellPath.sync());
//=> '/usr/local/bin:/usr/bin:...'
Synchronous version. Returns the $PATH
.
- fix-path - Fix the $PATH on OS X when run from a GUI app
MIT © Sindre Sorhus