import { ConnectableObservable , from } from "rxjs" ; import { first , publishReplay , tap } from "rxjs/operators" ; import shellEnv from "shell-env" ; const env$ = from ( shellEnv ( ) ) . pipe ( first ( ) , tap ( env => { if ( process . platform !== "darwin" || ( process . env != null && process . env . TERM === undefined ) ) { Object . assign ( process . env , env ) ; } } ) , publishReplay ( 1 ) ) ; ( env$ as ConnectableObservable < { } > ) . connect ( ) ; export default env$ ;