Skip to content

Commit d2bb7d1

Browse files
committed
fix: add check for npm
1 parent 3fadfac commit d2bb7d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lgsm/modules/check_gamedig.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
# Website: https://linuxgsm.com
66
# Description: Installs nodejs and gamedig
77

8-
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
8+
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
99
echo -e ""
1010
echo -e "${bold}${lightyellow}Installing Gamedig${default}"
1111
fn_script_log_info "Installing Gamedig"
1212
cd "${lgsmdir}" || exit
1313
curl -L -o package.json "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/package.json"
1414
npm install
15-
elif [ "$(command -v node)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ]; then
15+
elif [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ]; then
1616
cd "${lgsmdir}" || exit
1717
curl -s -L -o package.json "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/package.json"
1818
npm update > /dev/null 2>&1

0 commit comments

Comments
 (0)