From 3bb2634d2f871e1b049cd4994fffe236ed7df78f Mon Sep 17 00:00:00 2001 From: Aravind Ramanathan Date: Tue, 7 Aug 2012 23:22:27 -0700 Subject: [PATCH] Added check for unsetopt unsetopt doesn't exist on OSX by default which causes `. nvm.sh` to fail at that line. --- nvm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index ad4e4d5..9e157a6 100755 --- a/nvm.sh +++ b/nvm.sh @@ -12,7 +12,9 @@ fi # Make zsh glob matching behave same as bash # This fixes the "zsh: no matches found" errors -unsetopt nomatch 2>/dev/null +if [[ `which unsetopt` ]]; then + unsetopt nomatch 2>/dev/null +fi # Expand a version using the version cache nvm_version()