Do not leak local vars to shell
This commit is contained in:
parent
054f3a8439
commit
ec7266334e
9
zshenv
9
zshenv
|
@ -1,7 +1,10 @@
|
|||
export ZDOTDIR="${$(readlink $HOME/.zshenv):h:a}"
|
||||
|
||||
exists() { command -v "$@" >/dev/null }
|
||||
for i in $ZDOTDIR/env/*.zsh; do
|
||||
. $i
|
||||
done
|
||||
function(){
|
||||
local i
|
||||
for i in $ZDOTDIR/env/*.zsh; do
|
||||
. $i
|
||||
done
|
||||
}
|
||||
|
||||
|
|
15
zshrc
15
zshrc
|
@ -28,6 +28,7 @@ zdotfile() {
|
|||
fi
|
||||
}
|
||||
try-source() {
|
||||
local i=0
|
||||
for i in "$@"; do
|
||||
if [[ -e "$i" ]]; then
|
||||
source $i
|
||||
|
@ -36,8 +37,9 @@ try-source() {
|
|||
}
|
||||
exists() { command -v "$@" >/dev/null }
|
||||
|
||||
local dirfile=$(zdotfile dirs)
|
||||
try-source $dirfile
|
||||
function(){
|
||||
try-source $(zdotfile dirs)
|
||||
}
|
||||
|
||||
. $(zdotfile completion.zsh)
|
||||
|
||||
|
@ -47,9 +49,12 @@ source $(zdotfile zplug.zsh)
|
|||
|
||||
stty -ixon
|
||||
|
||||
for i in ${ZDOTDIR:+$ZDOTDIR/aliases/*~*.zwc(N)} /etc/zsh/aliases/*~*.zwc(N); do
|
||||
. $i
|
||||
done
|
||||
function(){
|
||||
local i=0
|
||||
for i in ${ZDOTDIR:+$ZDOTDIR/aliases/*~*.zwc(N)} /etc/zsh/aliases/*~*.zwc(N); do
|
||||
. $i
|
||||
done
|
||||
}
|
||||
|
||||
if ! (grep -q 'local' <<<$PATH && grep -q 'sbin' <<<$PATH); then
|
||||
. /etc/zsh/zprofile
|
||||
|
|
Loading…
Reference in a new issue