Fix scripts using import env always exiting
This commit is contained in:
parent
b9b6e44f98
commit
584c900e84
5 changed files with 9 additions and 6 deletions
|
@ -3,7 +3,10 @@ import-env() {
|
|||
SOURCE_PID=$(pgrep $source_name | head -n 1)
|
||||
if [[ -n $SOURCE_PID ]]; then break; fi
|
||||
done
|
||||
if [[ -z $SOURCE_PID ]]; then return 1; fi
|
||||
if [[ -z $SOURCE_PID ]]; then
|
||||
echo "import-env: No matching process for: $*"
|
||||
return 1;
|
||||
fi
|
||||
|
||||
SOURCE_ENV=("${(@ps:\000:)$(</proc/${SOURCE_PID}/environ)}")
|
||||
export ${SOURCE_ENV[@]:#}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue