2016-10-27 02:04:14 +08:00
|
|
|
src() {
|
|
|
|
local cache="$ZSH_CACHE_DIR"
|
|
|
|
autoload -U compinit zrecompile
|
2016-10-27 02:09:08 +08:00
|
|
|
compinit -i -d "$cache/zcomp-$HOST"
|
2014-03-26 05:16:36 +08:00
|
|
|
|
2020-02-29 04:01:35 +08:00
|
|
|
for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do
|
2016-10-27 02:04:14 +08:00
|
|
|
zrecompile -p $f && command rm -f $f.zwc.old
|
|
|
|
done
|
2014-03-26 05:16:36 +08:00
|
|
|
|
2020-08-24 23:48:39 +08: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-26 05:16:36 +08:00
|
|
|
}
|