From 2babe683727532eeecc7814c4830f2d080463260 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 8 Jul 2016 20:15:49 +0100 Subject: [PATCH] Add update function --- zsh-nvm.plugin.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zsh-nvm.plugin.zsh b/zsh-nvm.plugin.zsh index 955f4a8..c360509 100644 --- a/zsh-nvm.plugin.zsh +++ b/zsh-nvm.plugin.zsh @@ -26,6 +26,16 @@ _zsh_nvm_install() { git checkout --quiet "$(_zsh_nvm_latest_release_tag)" } +nvm_update() { + echo "Checking latest version of nvm..." + local latest_version=$(_zsh_nvm_latest_release_tag) + echo "Latest version is $latest_version" + echo "Fetching updates..." + cd "$NVM_DIR" + git fetch + git checkout "$latest_version" +} + # Install nvm if it isn't already installed [[ ! -f "$NVM_DIR/nvm.sh" ]] && _zsh_nvm_install