Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

rubickCenter/shell-path

 
 

Repository files navigation

shell-path

Get the $PATH from the shell

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

Install

$ npm install shell-path

Usage

When executed from a GUI app on macOS:

import {shellPath} from 'shell-path';

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

console.log(await shellPath());
//=> '/usr/local/bin:/usr/bin:...'

API

shellPath()

Return a promise for the $PATH.

shellPathSync()

Returns the $PATH.

Related

  • fix-path - Fix the $PATH on macOS when run from a GUI app
  • shell-env - Get environment variables from the shell
  • shell-history - Get the command history of the user's shell

About

Get the $PATH from the shell

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.