From 3767e6ecc5e181e15d19e0d0f008aa00ca7d0a28 Mon Sep 17 00:00:00 2001 From: Michael Mao Date: Fri, 6 Oct 2023 19:33:53 +0800 Subject: [PATCH 1/3] add nvs v1.7.1 --- Casks/n/nvs.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Casks/n/nvs.rb diff --git a/Casks/n/nvs.rb b/Casks/n/nvs.rb new file mode 100644 index 0000000000..82ccc46fc5 --- /dev/null +++ b/Casks/n/nvs.rb @@ -0,0 +1,29 @@ +cask "nvs" do + version "1.7.1" + sha256 "0df024c8c8489a63674cac148e766eab0cc2de3cd8e97c6caffd8e117a09863e" + + url "https://github.com/jasongin/nvs/archive/refs/tags/v#{version}.tar.gz" + name "Node Version Switcher" + desc "Cross-platform tool for switching between versions and forks of Node.js" + homepage "https://github.com/jasongin/nvs" + + livecheck do + url "https://github.com/jasongin/nvs/releases/latest" + strategy :page_match + regex(%r{/nvs/releases/tag/v(\d+(?:\.\d+)+)}i) + end + + installer script: { + executable: "nvs-#{version}/homebrew/install.sh", + args: ["#{caskroom_path}/latest"], + } + + uninstall trash: "~/.nvs" + + caveats <<~EOS + NVS installs all Node.js versions to ~/.nvs by default. + To change this behavior, please remove ~/.nvs and make the following + modification to your shell profile + export $NVS_HOME=/your/preferred/location + EOS +end From 3e18aad67aeefbebd6fba395148f25c13cb5d273 Mon Sep 17 00:00:00 2001 From: Miccal Matthews Date: Sat, 7 Oct 2023 10:22:15 +0800 Subject: [PATCH 2/3] Update nvs.rb --- Casks/n/nvs.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Casks/n/nvs.rb b/Casks/n/nvs.rb index 82ccc46fc5..2259a05f99 100644 --- a/Casks/n/nvs.rb +++ b/Casks/n/nvs.rb @@ -7,23 +7,17 @@ cask "nvs" do desc "Cross-platform tool for switching between versions and forks of Node.js" homepage "https://github.com/jasongin/nvs" - livecheck do - url "https://github.com/jasongin/nvs/releases/latest" - strategy :page_match - regex(%r{/nvs/releases/tag/v(\d+(?:\.\d+)+)}i) - end - installer script: { executable: "nvs-#{version}/homebrew/install.sh", args: ["#{caskroom_path}/latest"], } - uninstall trash: "~/.nvs" + zap trash: "~/.nvs" caveats <<~EOS NVS installs all Node.js versions to ~/.nvs by default. - To change this behavior, please remove ~/.nvs and make the following - modification to your shell profile + To change this behavior, remove ~/.nvs and make the + following modification to your shell profile: export $NVS_HOME=/your/preferred/location EOS end From a2b3e6b190514b8273d8e50b28f639abd260ab26 Mon Sep 17 00:00:00 2001 From: Miccal Matthews Date: Sat, 7 Oct 2023 10:41:01 +0800 Subject: [PATCH 3/3] Update nvs.rb --- Casks/n/nvs.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Casks/n/nvs.rb b/Casks/n/nvs.rb index 2259a05f99..6c2007d29e 100644 --- a/Casks/n/nvs.rb +++ b/Casks/n/nvs.rb @@ -12,7 +12,9 @@ cask "nvs" do args: ["#{caskroom_path}/latest"], } - zap trash: "~/.nvs" + uninstall trash: "~/.nvs" + + # No zap stanza required caveats <<~EOS NVS installs all Node.js versions to ~/.nvs by default.