From 3f214329d631b3ae39d6b283262c77819a0078de Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 28 Mar 2022 13:38:49 +0200 Subject: [PATCH] chore: removing old completion code (#10616) --- plugins/cargo/cargo.plugin.zsh | 8 -------- plugins/deno/deno.plugin.zsh | 13 ------------- plugins/fnm/fnm.plugin.zsh | 13 ------------- plugins/gh/gh.plugin.zsh | 13 ------------- plugins/helm/helm.plugin.zsh | 9 --------- plugins/kubectl/kubectl.plugin.zsh | 9 --------- plugins/rbw/rbw.plugin.zsh | 6 ------ plugins/rust/rust.plugin.zsh | 5 ----- plugins/rustup/rustup.plugin.zsh | 8 -------- plugins/volta/volta.plugin.zsh | 5 ----- 10 files changed, 89 deletions(-) diff --git a/plugins/cargo/cargo.plugin.zsh b/plugins/cargo/cargo.plugin.zsh index e4b338207..692025e8f 100644 --- a/plugins/cargo/cargo.plugin.zsh +++ b/plugins/cargo/cargo.plugin.zsh @@ -1,14 +1,6 @@ print ${(%):-'%F{yellow}The `cargo` plugin is deprecated and has been moved to the `rust` plugin.'} print ${(%):-'Please update your .zshrc to use the `%Brust%b` plugin instead.%f'} -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# Remove old generated completion file -command rm -f "${0:A:h}/_cargo" "$ZSH_CACHE_DIR/cargo_version" - (( ${fpath[(Ie)$ZSH/plugins/rust]} )) || { fpath=("$ZSH/plugins/rust" $fpath) source "$ZSH/plugins/rust/rust.plugin.zsh" diff --git a/plugins/deno/deno.plugin.zsh b/plugins/deno/deno.plugin.zsh index 6c12bae13..7708f84df 100644 --- a/plugins/deno/deno.plugin.zsh +++ b/plugins/deno/deno.plugin.zsh @@ -16,19 +16,6 @@ if (( ! $+commands[deno] )); then return fi -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# Remove old generated files -command rm -f "${0:A:h}/_deno" "$ZSH_CACHE_DIR/deno_version" - -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `deno`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_deno" ]]; then diff --git a/plugins/fnm/fnm.plugin.zsh b/plugins/fnm/fnm.plugin.zsh index 044e16a04..6219025cd 100644 --- a/plugins/fnm/fnm.plugin.zsh +++ b/plugins/fnm/fnm.plugin.zsh @@ -2,19 +2,6 @@ if (( ! $+commands[fnm] )); then return fi -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# remove old generated files -command rm -f "${0:A:h}/_fnm" "$ZSH_CACHE_DIR/fnm_version" - -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `fnm`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_fnm" ]]; then diff --git a/plugins/gh/gh.plugin.zsh b/plugins/gh/gh.plugin.zsh index 9263220ca..1d8d84c55 100644 --- a/plugins/gh/gh.plugin.zsh +++ b/plugins/gh/gh.plugin.zsh @@ -3,19 +3,6 @@ if (( ! $+commands[gh] )); then return fi -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# Remove old generated files -command rm -f "${0:A:h}/_gh" "$ZSH_CACHE_DIR/gh_version" - -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `gh`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_gh" ]]; then diff --git a/plugins/helm/helm.plugin.zsh b/plugins/helm/helm.plugin.zsh index 05bb19a44..151c43d88 100644 --- a/plugins/helm/helm.plugin.zsh +++ b/plugins/helm/helm.plugin.zsh @@ -2,15 +2,6 @@ if (( ! $+commands[helm] )); then return fi -# TODO: 2021-12-28: delete this block -# Remove old generated file -command rm -f "${ZSH_CACHE_DIR}/helm_completion" - -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file does not exist, generate it and then source it # Otherwise, source it and regenerate in the background if [[ ! -f "$ZSH_CACHE_DIR/completions/_helm" ]]; then diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 0ee252ac3..095d2b328 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -1,13 +1,4 @@ if (( $+commands[kubectl] )); then - # TODO: 2022-01-05: remove this block - # remove old generated files - command rm -f "$ZSH_CACHE_DIR/kubectl_completion" - - # TODO: 2022-01-05: remove this bit of code as it exists in oh-my-zsh.sh - # Add completions folder in $ZSH_CACHE_DIR - command mkdir -p "$ZSH_CACHE_DIR/completions" - (( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file does not exist, generate it and then source it # Otherwise, source it and regenerate in the background if [[ ! -f "$ZSH_CACHE_DIR/completions/_kubectl" ]]; then diff --git a/plugins/rbw/rbw.plugin.zsh b/plugins/rbw/rbw.plugin.zsh index 523e35aff..b6cecf8b4 100644 --- a/plugins/rbw/rbw.plugin.zsh +++ b/plugins/rbw/rbw.plugin.zsh @@ -2,12 +2,6 @@ if (( ! $+commands[rbw] )); then return fi -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `rbw`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_rbw" ]]; then diff --git a/plugins/rust/rust.plugin.zsh b/plugins/rust/rust.plugin.zsh index db6ca9e74..858f14126 100644 --- a/plugins/rust/rust.plugin.zsh +++ b/plugins/rust/rust.plugin.zsh @@ -2,11 +2,6 @@ if ! (( $+commands[rustup] && $+commands[cargo] )); then return fi -# Add completions folder in $ZSH_CACHE_DIR -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `cargo`. Otherwise, compinit will have already done that if [[ ! -f "$ZSH_CACHE_DIR/completions/_cargo" ]]; then diff --git a/plugins/rustup/rustup.plugin.zsh b/plugins/rustup/rustup.plugin.zsh index 3d59c1c54..ef141cf8f 100644 --- a/plugins/rustup/rustup.plugin.zsh +++ b/plugins/rustup/rustup.plugin.zsh @@ -1,14 +1,6 @@ print ${(%):-'%F{yellow}The `rustup` plugin is deprecated and has been moved to the `rust` plugin.'} print ${(%):-'Please update your .zshrc to use the `%Brust%b` plugin instead.%f'} -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# Remove old generated completion file -command rm -f "${0:A:h}/_rustup" "$ZSH_CACHE_DIR/rustup_version" - (( ${fpath[(Ie)$ZSH/plugins/rust]} )) || { fpath=("$ZSH/plugins/rust" $fpath) source "$ZSH/plugins/rust/rust.plugin.zsh" diff --git a/plugins/volta/volta.plugin.zsh b/plugins/volta/volta.plugin.zsh index 79319394c..ab05ed5df 100644 --- a/plugins/volta/volta.plugin.zsh +++ b/plugins/volta/volta.plugin.zsh @@ -3,11 +3,6 @@ if (( ! $+commands[volta] )); then return fi -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `deno`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_volta" ]]; then