From 93bb37810e7f9e8bad58de7dfe29b335ab1c93ea Mon Sep 17 00:00:00 2001 From: "Guo, Quan" <1118270+guoquan@users.noreply.github.com> Date: Wed, 2 Jun 2021 15:08:15 +0800 Subject: [PATCH] Update get-hook-script.js --- src/utils/get-hook-script.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/get-hook-script.js b/src/utils/get-hook-script.js index 87b270022..f7a92df16 100644 --- a/src/utils/get-hook-script.js +++ b/src/utils/get-hook-script.js @@ -28,8 +28,13 @@ function platformSpecific() { # Node standard installation path /usr/local export PATH="$PATH:/usr/local/bin:/usr/local" - # Try to load nvm using path of standard installation - load_nvm ${home}/.nvm + # Try to load nvm using path of standard installation ${home}/.nvm and + # Brew standard installation /usr/local/opt/nvm + if [[ -d "${home}/.nvm" ]]; then + load_nvm "${home}/.nvm" + elif [[ -d "/usr/local/opt/nvm" ]]; then + load_nvm "/usr/local/opt/nvm" + else run_nvm` )