From b5583a321644218702c4ef588934575f46a2159b Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Wed, 3 Jan 2024 04:02:43 -0800 Subject: fix(rtx)!: rename `rtx` plugin to `mise` (#12143) BREAKING CHANGE: Rename `rtx` plugin to `mise`. The project swapped name in `v2024.1.0`. Replace references to `rtx` with `mise` while maintaining backwards compatibility for `rtx` installations. Co-authored-by: Carlo Sala --- plugins/mise/mise.plugin.zsh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugins/mise/mise.plugin.zsh (limited to 'plugins/mise/mise.plugin.zsh') diff --git a/plugins/mise/mise.plugin.zsh b/plugins/mise/mise.plugin.zsh new file mode 100644 index 000000000..1b4d3ae81 --- /dev/null +++ b/plugins/mise/mise.plugin.zsh @@ -0,0 +1,23 @@ +# TODO: 2024-01-03 remove rtx support +local __mise=mise +if (( ! $+commands[mise] )); then + if (( $+commands[rtx] )); then + __mise=rtx + else + return + fi +fi + +# Load mise hooks +eval "$($__mise activate zsh)" + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `mise`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_$__mise" ]]; then + typeset -g -A _comps + autoload -Uz _$__mise + _comps[$__mise]=_$__mise +fi + +# Generate and load mise completion +$__mise completion zsh >| "$ZSH_CACHE_DIR/completions/_$__mise" &| -- cgit v1.2.3-70-g09d2