mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-25 11:14:51 +00:00
Testable install script
* wraps main code into a function * EnvVar-based install start * Clean environment after install
This commit is contained in:
6
test/install_script/nvm_do_install
Executable file
6
test/install_script/nvm_do_install
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
NVM_ENV=testing . ../../install.sh
|
||||
|
||||
#nvm_do_install is available
|
||||
type nvm_do_install > /dev/null 2>&1
|
21
test/install_script/nvm_reset
Executable file
21
test/install_script/nvm_reset
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
NVM_ENV=testing . ../../install.sh
|
||||
|
||||
safe_type() {
|
||||
type "$1" > /dev/null 2>&1 && return 0 || return 1
|
||||
}
|
||||
|
||||
# Check nvm_reset exists
|
||||
type nvm_reset > /dev/null 2>&1
|
||||
|
||||
# Apply nvm_reset
|
||||
nvm_reset
|
||||
|
||||
# The names should be unset
|
||||
! safe_type nvm_do_install && \
|
||||
! safe_type nvm_has && \
|
||||
! safe_type nvm_download && \
|
||||
! safe_type install_nvm_as_script && \
|
||||
! safe_type install_nvm_from_git && \
|
||||
! safe_type nvm_reset
|
Reference in New Issue
Block a user