-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Node] - nvm - fallback to previous version - code fix (#904)
* [node] - nvm - added fallback to prev. version - if latest version tag released but binary not found * bumped patch version
- Loading branch information
1 parent
8af4ce3
commit 460684d
Showing
4 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
set -e | ||
|
||
trap 'echo "Error occurred at line $LINENO"; exit 1' ERR | ||
source /usr/local/share/nvm/nvm.sh | ||
#check nvm version | ||
echo -e "\n✅ nvm version as installed by feature = v$(nvm --version)"; | ||
NVM_DIR="/usr/local/share/nvm" | ||
NODE_VERSION="lts" | ||
FAKE_NVM_VERSION="1.2.XYZ" | ||
curl -so- "https://raw.githubusercontent.com/nvm-sh/nvm/v${FAKE_NVM_VERSION}/install.sh" | bash || { | ||
PREV_NVM_VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/') | ||
curl -so- "https://raw.githubusercontent.com/nvm-sh/nvm/${PREV_NVM_VERSION}/install.sh" | bash | ||
NVM_VERSION="${PREV_NVM_VERSION}" | ||
} | ||
|
||
#check nvm version | ||
echo -e "\n✅ nvm version as installed by test = v$(nvm --version)"; | ||
|
||
# Report result | ||
reportResults |
This file contains 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 characters