Merge pull request #519 from return42/fix-make-clean

[fix] make nvm.clean - don't raise error when NVM is not installed
This commit is contained in:
Markus Heiser 2021-11-19 13:28:51 +01:00 committed by GitHub
commit be793f7612
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,14 +120,17 @@ nvm.install() {
nvm.clean() { nvm.clean() {
if ! nvm.is_installed; then if ! nvm.is_installed; then
info_msg "NVM is not installed" build_msg CLEAN "[NVM] not installed"
return 42 return
fi fi
if ! nvm.is_local; then if ! nvm.is_local; then
info_msg "can't remove NVM from ${NVM_DIR}" build_msg CLEAN "[NVM] can't remove nvm from ${NVM_DIR}"
return 42 return
fi fi
if [ -n "${NVM_DIR}" ]; then
build_msg CLEAN "[NVM] drop $(realpath --relative-to=. "${NVM_DIR}")/"
rm -rf "${NVM_DIR}" rm -rf "${NVM_DIR}"
fi
} }
nvm.status(){ nvm.status(){