lib: add import-env
This commit is contained in:
parent
6345cbdb09
commit
3eb81b9445
2 changed files with 9 additions and 4 deletions
|
@ -64,3 +64,10 @@ pip-venv-deps() {
|
|||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
import-env() {
|
||||
SOURCE_PROCESS=$1
|
||||
SOURCE_PID=$(pgrep $SOURCE_PROCESS | head -n 1)
|
||||
SOURCE_ENV=("${(@ps:\000:)$(</proc/${SOURCE_PID}/environ)}")
|
||||
export ${SOURCE_ENV[@]:#}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue