From bf0d80855471b4cfd06185e07330b9c1f704176e Mon Sep 17 00:00:00 2001 From: Brett Petch Date: Mon, 29 Apr 2024 07:57:30 -0400 Subject: [PATCH 1/3] nvm: track latest --- race-ready.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/race-ready.sh b/race-ready.sh index 162e1e6..5e1fa1f 100755 --- a/race-ready.sh +++ b/race-ready.sh @@ -19,7 +19,8 @@ function _nvm() { ## Function for installing nvm. if [[ ! -d /home/$user/.nvm ]]; then echo "Installing node" - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash >> "$log" 2>&1 + nvmVersion=$(github_latest_version "nvm-sh/nvm") + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${nvmVersion}/install.sh | bash >> "$log" 2>&1 echo "nvm installed." else echo "nvm is already installed." From e042b1fd40b67d322195715fe9b629d11bd00159 Mon Sep 17 00:00:00 2001 From: Brett Petch Date: Mon, 29 Apr 2024 08:00:58 -0400 Subject: [PATCH 2/3] nvm bump --- jellyseerr.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jellyseerr.sh b/jellyseerr.sh index c01f662..a605eef 100755 --- a/jellyseerr.sh +++ b/jellyseerr.sh @@ -6,11 +6,20 @@ mkdir -p $HOME/.logs/ touch $HOME/.logs/jellyseerr.log export log="$HOME/.logs/jellyseerr.log" +function github_latest_version() { + # Function by Liara + # Argument expects the author/repo format + # e.g. swizzin/swizzin + repo=$1 + curl -fsSLI -o /dev/null -w %{url_effective} https://github.com/${repo}/releases/latest | grep -o '[^/]*$' +} + function _deps() { ## Function for installing nvm. if [[ ! -d "$HOME/.nvm" ]]; then echo "Installing node" - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash >> "$log" 2>&1 + nvmVersion=$(github_latest_version "nvm-sh/nvm") + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${nvmVersion}/install.sh | bash >> "$log" 2>&1 echo "nvm installed." else echo "nvm is already installed." From 0bcc1f32d32a87c73bd69baa5d13fd4510cbe6cb Mon Sep 17 00:00:00 2001 From: Brett Petch Date: Mon, 29 Apr 2024 08:01:52 -0400 Subject: [PATCH 3/3] lounge: nvm bump --- lounge.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lounge.sh b/lounge.sh index 2f9b0d3..1ef48bd 100755 --- a/lounge.sh +++ b/lounge.sh @@ -5,11 +5,20 @@ mkdir -p $HOME/.logs/ touch "$HOME/.logs/lounge.log" log="$HOME/.logs/lounge.log" +function github_latest_version() { + # Function by Liara + # Argument expects the author/repo format + # e.g. swizzin/swizzin + repo=$1 + curl -fsSLI -o /dev/null -w %{url_effective} https://github.com/${repo}/releases/latest | grep -o '[^/]*$' +} + function _deps() { ## Function for installing nvm. if [[ ! -d $HOME/.nvm ]]; then echo "Installing node" - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash >> "$log" 2>&1 + nvmVersion=$(github_latest_version "nvm-sh/nvm") + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${nvmVersion}/install.sh | bash >> "$log" 2>&1 echo "nvm installed." else echo "nvm is already installed."