Last active
March 30, 2023 07:18
-
-
Save rodush/30e6c53d464965c7d890e28bb289d12f to your computer and use it in GitHub Desktop.
Revisions
-
rodush renamed this gist
Jan 5, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rodush revised this gist
Jan 5, 2020 . No changes.There are no files selected for viewing
-
rodush created this gist
Jan 5, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ # Put this somewhere in the ~/.zshrc file load-nvmrc() { local nvmrc_path="$(pwd -P)/.nvmrc" if [[ -a "$nvmrc_path" ]]; then local nvmrc_node_version=$(cat "${nvmrc_path}") if [ "$nvmrc_node_version" = "N/A" ]; then n latest elif [ "$nvmrc_node_version" != "$current_node_version" ]; then n $nvmrc_node_version fi fi } add-zsh-hook chpwd load-nvmrc load-nvmrc