Comparing version 3.0.0 to 3.0.1
@@ -11,2 +11,7 @@ 'use strict'; | ||
const env = { | ||
// Disables Oh My Zsh auto-update thing that can block the process. | ||
DISABLE_AUTO_UPDATE: 'true' | ||
}; | ||
const parseEnv = env => { | ||
@@ -30,3 +35,3 @@ env = env.split('_SHELL_ENV_DELIMITER_')[1]; | ||
try { | ||
const {stdout} = await execa(shell || defaultShell, args); | ||
const {stdout} = await execa(shell || defaultShell, args, {env}); | ||
return parseEnv(stdout); | ||
@@ -48,3 +53,3 @@ } catch (error) { | ||
try { | ||
const {stdout} = execa.sync(shell || defaultShell, args); | ||
const {stdout} = execa.sync(shell || defaultShell, args, {env}); | ||
return parseEnv(stdout); | ||
@@ -51,0 +56,0 @@ } catch (error) { |
{ | ||
"name": "shell-env", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Get environment variables from the shell", | ||
"license": "MIT", | ||
"repository": "sindresorhus/shell-env", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
@@ -12,0 +13,0 @@ "engines": { |
@@ -1,8 +0,7 @@ | ||
# shell-env [![Build Status](https://travis-ci.org/sindresorhus/shell-env.svg?branch=master)](https://travis-ci.org/sindresorhus/shell-env) | ||
# shell-env | ||
> Get [environment variables](https://en.wikipedia.org/wiki/Environment_variable) from the [shell](https://en.wikipedia.org/wiki/Shell_(computing)) | ||
Especially useful for Electron apps as GUI apps on macOS doesn't inherit the environment variables defined in your dotfiles *(.bashrc/.bash_profile/.zshrc/etc)*. | ||
Especially useful for Electron apps as GUI apps on macOS doesn't inherit the environment variables defined in your dotfiles *(.bash_profile/.zshrc/etc)*. | ||
## Install | ||
@@ -14,3 +13,2 @@ | ||
## Usage | ||
@@ -28,10 +26,11 @@ | ||
## API | ||
### shellEnv([shell]) | ||
Note that for Bash, it reads [`.bash_profile`, but not `.bashrc`](https://apple.stackexchange.com/questions/51036/what-is-the-difference-between-bash-profile-and-bashrc). | ||
### shellEnv(shell?) | ||
Return a promise for the environment variables. | ||
### shellEnv.sync([shell]) | ||
### shellEnv.sync(shell?) | ||
@@ -42,3 +41,3 @@ Returns the environment variables. | ||
Type: `string`<br> | ||
Type: `string`\ | ||
Default: [User default shell](https://github.com/sindresorhus/default-shell) | ||
@@ -48,3 +47,2 @@ | ||
## Related | ||
@@ -56,3 +54,2 @@ | ||
## Maintainers | ||
@@ -62,6 +59,1 @@ | ||
- [@silverwind](https://github.com/silverwind) | ||
## License | ||
MIT |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5512
79
54