From 62c1014f4d8d0c1ed4765a71e6fa5506ee3544ed Mon Sep 17 00:00:00 2001 From: Rafael Antonio Lucio Date: Sun, 10 Dec 2017 00:33:07 -0200 Subject: [PATCH] Refactor to Coding Style Guide Reference of [Coding Style Guide](https://github.com/robbyrussell/oh-my-zsh/wiki/Coding-style-guide) --- plugins/nvm/nvm.plugin.zsh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index ed0b6d220..9e9ae5d07 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -11,29 +11,24 @@ load-nvmrc() { local node_version="$(nvm version)" local nvmrc_path="$(nvm_find_nvmrc)" - if [ -n "$nvmrc_path" ] - then + if [ -n "$nvmrc_path" ]; then local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") - if [ "$nvmrc_node_version" = "N/A" ] - then + if [ "$nvmrc_node_version" = "N/A" ]; then nvm install fi - if [ "$nvmrc_node_version" != "$node_version" ] - then + if [ "$nvmrc_node_version" != "$node_version" ]; then nvm use fi - elif [ "$node_version" != "$(nvm version default)" ] - then + elif [ "$node_version" != "$(nvm version default)" ]; then echo "Reverting to nvm default version" nvm use default fi } -if [[ "$ZSH_NVM_AUTOLOAD" == "true" ]] -then - autoload -U add-zsh-hook +if [[ "$ZSH_NVM_AUTOLOAD" == "true" ]]; then + autoload -U add-zsh-hook add-zsh-hook chpwd load-nvmrc load-nvmrc fi \ No newline at end of file