Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

License

Notifications You must be signed in to change notification settings

sindresorhus/fix-path

fix-path

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

Useful for Electron apps as GUI apps on macOS and Linux do not inherit the $PATH defined in your dotfiles (.bashrc/.bash_profile/.zshrc/etc).

Install

npm install fix-path

Usage

import fixPath from 'fix-path';

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

fixPath();

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

Known issues

  • Packaged Electron apps launched from Finder may not quit properly. This is an Electron bug where child processes spawned during startup are not cleaned up correctly in that context.

Related

About

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

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors