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