summaryrefslogtreecommitdiff
path: root/plugins/zsh_reload/zsh_reload.plugin.zsh
diff options
context:
space:
mode:
authorMonson Shao <holymonson@gmail.com>2020-07-03 12:16:58 +0800
committerMarc Cornellà <hello@mcornella.com>2021-10-04 16:24:05 +0200
commitbe4a952972de03d501fbff79435ae41594f06bac (patch)
tree7c4889006414d4d26433284c7d0f07b8971dede0 /plugins/zsh_reload/zsh_reload.plugin.zsh
parent56ab66b19429e5609e4331a987368ce2c844c7be (diff)
downloadzsh-be4a952972de03d501fbff79435ae41594f06bac.tar.gz
zsh-be4a952972de03d501fbff79435ae41594f06bac.tar.bz2
zsh-be4a952972de03d501fbff79435ae41594f06bac.zip
feat(cli)!: add `omz reload` command and deprecate `zsh_reload` plugin (#9078)
BREAKING CHANGE: the `zsh_reload` plugin is deprecated. Instead of using its `src` function, use `omz reload` or `exec zsh` to reload zsh after making changes to your `.zshrc` file. Closes #9078
Diffstat (limited to 'plugins/zsh_reload/zsh_reload.plugin.zsh')
-rw-r--r--plugins/zsh_reload/zsh_reload.plugin.zsh25
1 files changed, 5 insertions, 20 deletions
diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh
index 0d29a7ce3..6a058ec5e 100644
--- a/plugins/zsh_reload/zsh_reload.plugin.zsh
+++ b/plugins/zsh_reload/zsh_reload.plugin.zsh
@@ -1,22 +1,7 @@
-src() {
- local cache="$ZSH_CACHE_DIR"
- autoload -U compinit zrecompile
- compinit -i -d "$cache/zcomp-$HOST"
-
- for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do
- zrecompile -p $f && command rm -f $f.zwc.old
- done
+print ${(%):-"%F{yellow}The \`zsh_reload\` plugin is deprecated and will be removed."}
+print ${(%):-"Use \`%Bomz reload%b\` or \`%Bexec zsh%b\` instead.%f"}
- # 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
+src() {
+ print ${(%):-"%F{yellow}$0 is deprecated. Use \`%Bomz reload%b\` or \`%Bexec zsh%b\` instead.%f\n"}
+ omz reload
}