Fix the $PATH on macOS when run from a GUI app
JavaScript
Latest commit b9fa7c4 Nov 9, 2016 @sindresorhus 2.1.0
Permalink
Failed to load latest commit information.
.editorconfig [breaking] now requires Node.js >=4 Apr 6, 2016
.gitattributes init Apr 27, 2015
.gitignore init Apr 27, 2015
.travis.yml OS X → macOS Jun 14, 2016
index.js [breaking] now requires Node.js >=4 Apr 6, 2016
license init Apr 27, 2015
package.json 2.1.0 Nov 9, 2016
readme.md OS X → macOS Jun 14, 2016
test.js update tests for latest AVA version Jan 1, 2016

readme.md

fix-path Build Status

Fix the $PATH on macOS when run from a GUI app

Useful for Electron/NW.js apps as GUI apps on macOS doesn't inherit the $PATH defined in your dotfiles (.bashrc/.bash_profile/.zshrc/etc).

Install

$ npm install --save fix-path

Usage

const fixPath = require('fix-path');

console.log(process.env.PATH);
//=> '/usr/bin'

fixPath();

console.log(process.env.PATH);
//=> '/usr/local/bin:/usr/bin'

Related

License

MIT © Sindre Sorhus