Переглянути джерело

feat: add extra checks to fail if jq is not installed (#4731)

Daniel Gibbs 1 рік тому
батько
коміт
1639bd5d0d

+ 1 - 1
lgsm/modules/check.sh

@@ -54,7 +54,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do
 	fi
 done
 
-allowed_commands_array=(BACKUP DEBUG START)
+allowed_commands_array=(BACKUP DEBUG DETAILS START UPDATE)
 for allowed_command in "${allowed_commands_array[@]}"; do
 	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_deps.sh

+ 6 - 0
lgsm/modules/update_jk2.sh

@@ -152,6 +152,12 @@ fn_update_compare() {
 # The location where the builds are checked and downloaded.
 remotelocation="github.com"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${firstcommandname}" == "INSTALL" ]; then
 	fn_update_remotebuild
 	fn_update_dl

+ 6 - 0
lgsm/modules/update_mc.sh

@@ -167,6 +167,12 @@ fn_update_compare() {
 # The location where the builds are checked and downloaded.
 remotelocation="mojang.com"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${firstcommandname}" == "INSTALL" ]; then
 	fn_update_remotebuild
 	fn_update_dl

+ 6 - 0
lgsm/modules/update_mcb.sh

@@ -175,6 +175,12 @@ fn_update_compare() {
 # The location where the builds are checked and downloaded.
 remotelocation="minecraft.net"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${firstcommandname}" == "INSTALL" ]; then
 	fn_update_remotebuild
 	fn_update_dl

+ 6 - 0
lgsm/modules/update_mta.sh

@@ -160,6 +160,12 @@ fn_update_compare() {
 # The location where the builds are checked and downloaded.
 remotelocation="linux.mtasa.com"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${firstcommandname}" == "INSTALL" ]; then
 	fn_update_remotebuild
 	fn_update_dl

+ 6 - 0
lgsm/modules/update_pmc.sh

@@ -177,6 +177,12 @@ fn_update_compare() {
 # The location where the builds are checked and downloaded.
 remotelocation="papermc.io"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${shortname}" == "pmc" ]; then
 	paperproject="paper"
 elif [ "${shortname}" == "vpmc" ]; then

+ 6 - 0
lgsm/modules/update_ts3.sh

@@ -171,6 +171,12 @@ fi
 # The location where the builds are checked and downloaded.
 remotelocation="teamspeak.com"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${firstcommandname}" == "INSTALL" ]; then
 	fn_update_remotebuild
 	fn_update_dl

+ 6 - 0
lgsm/modules/update_ut99.sh

@@ -153,6 +153,12 @@ fn_update_compare() {
 # The location where the builds are checked and downloaded.
 remotelocation="github.com"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${firstcommandname}" == "INSTALL" ]; then
 	fn_update_remotebuild
 	fn_update_dl

+ 6 - 0
lgsm/modules/update_vints.sh

@@ -160,6 +160,12 @@ fn_update_compare() {
 # The location where the builds are checked and downloaded.
 remotelocation="vintagestory.at"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${firstcommandname}" == "INSTALL" ]; then
 	fn_update_remotebuild
 	fn_update_dl

+ 6 - 0
lgsm/modules/update_xnt.sh

@@ -160,6 +160,12 @@ fn_update_compare() {
 # The location where the builds are checked and downloaded.
 remotelocation="github.com"
 
+if [ "$(command -v jq 2> /dev/null)" ]; then
+	fn_print_fail_nl "jq is not installed"
+	fn_script_log_fatal "jq is not installed"
+	core_exit.sh
+fi
+
 if [ "${firstcommandname}" == "INSTALL" ]; then
 	fn_update_remotebuild
 	fn_update_dl