diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2022-09-23 18:21:41 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-02-11 13:18:07 +0100 |
commit | eebb489fb75b620469fecde8f233577bfbdbd9bb (patch) | |
tree | d668fcd46187e20e66ffecd4d8b4b5a1fc0a4e79 /utils/lib_nvm.sh | |
parent | 2cf1425e8bc5d3143b6e001e82a034a794e8a206 (diff) | |
download | searxng-eebb489fb75b620469fecde8f233577bfbdbd9bb.tar.gz searxng-eebb489fb75b620469fecde8f233577bfbdbd9bb.zip |
[fix] make nvm.env exit with error when VERBOSE is unset
$ make nvm.install
INFO: install (update) NVM at /800GBPCIex4/share/SearXNG/.nvm
INFO: already cloned at: /800GBPCIex4/share/SearXNG/.nvm
|| Fetching origin
INFO: checkout v0.39.1
|| HEAD is now at 9600617 v0.39.1
make: *** [Makefile:96: nvm.install] Error 1
Without this fix we need to set VERBOSE environment to avoid the 'Error 1':
$ VERBOSE=0 make nvm.install
BTW: fix an issue if there are any leftovers in ${NVM_DIR} from previos
installations
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/lib_nvm.sh')
-rwxr-xr-x | utils/lib_nvm.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/lib_nvm.sh b/utils/lib_nvm.sh index 6297d286d..aaea5cd31 100755 --- a/utils/lib_nvm.sh +++ b/utils/lib_nvm.sh @@ -27,6 +27,7 @@ nvm.env() { source "${NVM_DIR}/nvm.sh" source "${NVM_DIR}/bash_completion" [ "$VERBOSE" = "1" ] && info_msg "sourced NVM environment from ${NVM_DIR}" + return 0 } nvm.is_installed() { @@ -102,11 +103,15 @@ EOF nvm.install() { local NVM_VERSION_TAG info_msg "install (update) NVM at ${NVM_DIR}" - if [[ -d "${NVM_DIR}" ]] ; then + if nvm.is_installed; then info_msg "already cloned at: ${NVM_DIR}" pushd "${NVM_DIR}" &> /dev/null git fetch --all | prefix_stdout " ${_Yellow}||${_creset} " else + # delete any leftovers from previos installations + if nvm.is_local; then + rm -rf "${NVM_DIR}" + fi info_msg "clone: ${NVM_GIT_URL}" git clone "${NVM_GIT_URL}" "${NVM_DIR}" 2>&1 | prefix_stdout " ${_Yellow}||${_creset} " pushd "${NVM_DIR}" &> /dev/null |