From a26517f50c51deee904eb439cdaf7a1364bdd881 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sun, 27 Oct 2019 10:22:03 +0200 Subject: [PATCH] [zsh] remove useless `unset` from zplg --- zsh/zplg.zsh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/zsh/zplg.zsh b/zsh/zplg.zsh index 7575607..73b343e 100644 --- a/zsh/zplg.zsh +++ b/zsh/zplg.zsh @@ -146,7 +146,7 @@ _zplg_load() { _zplg_source_git_download() { local plugin_url="$1" plugin_dir="$2" - git clone --depth=1 --recurse-submodules -- "$plugin_url" "$plugin_dir" + git clone --recurse-submodules -- "$plugin_url" "$plugin_dir" } _zplg_source_git_upgrade() { @@ -154,6 +154,17 @@ _zplg_load() { ( cd "$plugin_dir" && git pull && git submodule update --init --recursive ) } + # small helper for the git source + plugin-git-checkout-latest-version() { + local latest_tag + git tag --list --sort -version:refname | read -r latest_tag + if (( ${#tags} == 0 )); then + _zplg_error "$0: no tags in the Git repository" + return 1 + fi + # git checkout + } + _zplg_source_github_download() { local plugin_url="$1" plugin_dir="$2" _zplg_source_git_download "https://github.com/$plugin_url.git" "$plugin_dir" @@ -343,7 +354,6 @@ plugin() { # extra ${...} is needed to turn array into a string by joining it with # spaces ZPLG_LOADED_PLUGIN_BUILD_CMDS[$plugin_id]="${${(@q)plugin_build}}" - unset plugin_build_quoted fi } always {