Ver Fonte

fix(gamedig): ensure that node modules are valid

Daniel Gibbs há 1 ano atrás
pai
commit
a7a8e38152
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      lgsm/modules/check_gamedig.sh

+ 5 - 1
lgsm/modules/check_gamedig.sh

@@ -10,6 +10,10 @@ if [ "$(command -v node)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)
 	echo -e "${bold}${lightyellow}Installing Gamedig${default}"
 	fn_script_log_info "Installing Gamedig"
 	cd "${lgsmdir}" || exit
-	wget -N --no-check-certificate "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${githubbranch}/package.json"
+	curl -L -o package.json "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${githubbranch}/package.json"
 	npm install
+elif [ "$(command -v node)" ] && [ "$(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/GameServerManagers/LinuxGSM/${githubbranch}/package.json"
+	npm update > /dev/null 2>&1
 fi