2016-10-26 18:04:14 +00:00
|
|
|
src() {
|
|
|
|
local cache="$ZSH_CACHE_DIR"
|
|
|
|
autoload -U compinit zrecompile
|
2016-10-26 18:09:08 +00:00
|
|
|
compinit -i -d "$cache/zcomp-$HOST"
|
2014-03-25 21:16:36 +00:00
|
|
|
|
2020-02-28 20:01:35 +00:00
|
|
|
for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do
|
2016-10-26 18:04:14 +00:00
|
|
|
zrecompile -p $f && command rm -f $f.zwc.old
|
|
|
|
done
|
2014-03-25 21:16:36 +00:00
|
|
|
|
2020-08-24 15:48:39 +00:00
|
|
|
# Use $SHELL if it's available and a zsh shell
|
|
|
|
local shell="$ZSH_ARGZERO"
|
|
|
|
if [[ "${${SHELL:t}#-}" = zsh ]]; then
|
|
|
|
shell="$SHELL"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Remove leading dash if login shell and run accordingly
|
|
|
|
if [[ "${shell:0:1}" = "-" ]]; then
|
|
|
|
exec -l "${shell#-}"
|
|
|
|
else
|
|
|
|
exec "$shell"
|
|
|
|
fi
|
2014-03-25 21:16:36 +00:00
|
|
|
}
|