mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Source nvm in script
This commit is contained in:
parent
6bbd3f5955
commit
10a2407b32
2 changed files with 18 additions and 2 deletions
|
|
@ -161,7 +161,15 @@ remove_volta_installation() {
|
||||||
|
|
||||||
# Check and uninstall nvm-managed package if present across all Node versions
|
# Check and uninstall nvm-managed package if present across all Node versions
|
||||||
remove_nvm_installation() {
|
remove_nvm_installation() {
|
||||||
# Check if nvm is available as a command
|
# nvm is a shell function, not a binary, so we need to source it first
|
||||||
|
if [ -s "$HOME/.nvm/nvm.sh" ]; then
|
||||||
|
# Source nvm to make it available in this script
|
||||||
|
. "$HOME/.nvm/nvm.sh" >/dev/null 2>&1
|
||||||
|
elif [ -s "$NVM_DIR/nvm.sh" ]; then
|
||||||
|
. "$NVM_DIR/nvm.sh" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if nvm is now available
|
||||||
if ! command_exists nvm; then
|
if ! command_exists nvm; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,15 @@ remove_volta_installation() {
|
||||||
|
|
||||||
# Check and uninstall nvm-managed package if present across all Node versions
|
# Check and uninstall nvm-managed package if present across all Node versions
|
||||||
remove_nvm_installation() {
|
remove_nvm_installation() {
|
||||||
# Check if nvm is available as a command
|
# nvm is a shell function, not a binary, so we need to source it first
|
||||||
|
if [ -s "$HOME/.nvm/nvm.sh" ]; then
|
||||||
|
# Source nvm to make it available in this script
|
||||||
|
. "$HOME/.nvm/nvm.sh" >/dev/null 2>&1
|
||||||
|
elif [ -s "$NVM_DIR/nvm.sh" ]; then
|
||||||
|
. "$NVM_DIR/nvm.sh" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if nvm is now available
|
||||||
if ! command_exists nvm; then
|
if ! command_exists nvm; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue