Skip to content

Commit

Permalink
fix: add check for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Sep 22, 2024
1 parent 3fadfac commit d2bb7d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lgsm/modules/check_gamedig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d2bb7d1

Please sign in to comment.