From d2bb7d1af654e828af7c6b2c698a86b992ac9754 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 22 Sep 2024 22:38:01 +0100 Subject: [PATCH] fix: add check for npm --- lgsm/modules/check_gamedig.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/check_gamedig.sh b/lgsm/modules/check_gamedig.sh index b1913cf875..70aeea41bd 100644 --- a/lgsm/modules/check_gamedig.sh +++ b/lgsm/modules/check_gamedig.sh @@ -5,14 +5,14 @@ # Website: https://linuxgsm.com # Description: Installs nodejs and gamedig -if [ "$(command -v node)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then +if [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then echo -e "" echo -e "${bold}${lightyellow}Installing Gamedig${default}" fn_script_log_info "Installing Gamedig" cd "${lgsmdir}" || exit curl -L -o package.json "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/package.json" npm install -elif [ "$(command -v node)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ]; then +elif [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ]; then cd "${lgsmdir}" || exit curl -s -L -o package.json "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/package.json" npm update > /dev/null 2>&1