Skip to content

Commit 1639bd5

Browse files
authored
feat: add extra checks to fail if jq is not installed (#4731)
1 parent abfe5c1 commit 1639bd5

File tree

10 files changed

+55
-1
lines changed

10 files changed

+55
-1
lines changed

lgsm/modules/check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do
5454
fi
5555
done
5656

57-
allowed_commands_array=(BACKUP DEBUG START)
57+
allowed_commands_array=(BACKUP DEBUG DETAILS START UPDATE)
5858
for allowed_command in "${allowed_commands_array[@]}"; do
5959
if [ "${allowed_command}" == "${commandname}" ]; then
6060
check_deps.sh

lgsm/modules/update_jk2.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ fn_update_compare() {
152152
# The location where the builds are checked and downloaded.
153153
remotelocation="github.com"
154154

155+
if [ "$(command -v jq 2> /dev/null)" ]; then
156+
fn_print_fail_nl "jq is not installed"
157+
fn_script_log_fatal "jq is not installed"
158+
core_exit.sh
159+
fi
160+
155161
if [ "${firstcommandname}" == "INSTALL" ]; then
156162
fn_update_remotebuild
157163
fn_update_dl

lgsm/modules/update_mc.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ fn_update_compare() {
167167
# The location where the builds are checked and downloaded.
168168
remotelocation="mojang.com"
169169

170+
if [ "$(command -v jq 2> /dev/null)" ]; then
171+
fn_print_fail_nl "jq is not installed"
172+
fn_script_log_fatal "jq is not installed"
173+
core_exit.sh
174+
fi
175+
170176
if [ "${firstcommandname}" == "INSTALL" ]; then
171177
fn_update_remotebuild
172178
fn_update_dl

lgsm/modules/update_mcb.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ fn_update_compare() {
175175
# The location where the builds are checked and downloaded.
176176
remotelocation="minecraft.net"
177177

178+
if [ "$(command -v jq 2> /dev/null)" ]; then
179+
fn_print_fail_nl "jq is not installed"
180+
fn_script_log_fatal "jq is not installed"
181+
core_exit.sh
182+
fi
183+
178184
if [ "${firstcommandname}" == "INSTALL" ]; then
179185
fn_update_remotebuild
180186
fn_update_dl

lgsm/modules/update_mta.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ fn_update_compare() {
160160
# The location where the builds are checked and downloaded.
161161
remotelocation="linux.mtasa.com"
162162

163+
if [ "$(command -v jq 2> /dev/null)" ]; then
164+
fn_print_fail_nl "jq is not installed"
165+
fn_script_log_fatal "jq is not installed"
166+
core_exit.sh
167+
fi
168+
163169
if [ "${firstcommandname}" == "INSTALL" ]; then
164170
fn_update_remotebuild
165171
fn_update_dl

lgsm/modules/update_pmc.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ fn_update_compare() {
177177
# The location where the builds are checked and downloaded.
178178
remotelocation="papermc.io"
179179

180+
if [ "$(command -v jq 2> /dev/null)" ]; then
181+
fn_print_fail_nl "jq is not installed"
182+
fn_script_log_fatal "jq is not installed"
183+
core_exit.sh
184+
fi
185+
180186
if [ "${shortname}" == "pmc" ]; then
181187
paperproject="paper"
182188
elif [ "${shortname}" == "vpmc" ]; then

lgsm/modules/update_ts3.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ fi
171171
# The location where the builds are checked and downloaded.
172172
remotelocation="teamspeak.com"
173173

174+
if [ "$(command -v jq 2> /dev/null)" ]; then
175+
fn_print_fail_nl "jq is not installed"
176+
fn_script_log_fatal "jq is not installed"
177+
core_exit.sh
178+
fi
179+
174180
if [ "${firstcommandname}" == "INSTALL" ]; then
175181
fn_update_remotebuild
176182
fn_update_dl

lgsm/modules/update_ut99.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ fn_update_compare() {
153153
# The location where the builds are checked and downloaded.
154154
remotelocation="github.com"
155155

156+
if [ "$(command -v jq 2> /dev/null)" ]; then
157+
fn_print_fail_nl "jq is not installed"
158+
fn_script_log_fatal "jq is not installed"
159+
core_exit.sh
160+
fi
161+
156162
if [ "${firstcommandname}" == "INSTALL" ]; then
157163
fn_update_remotebuild
158164
fn_update_dl

lgsm/modules/update_vints.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ fn_update_compare() {
160160
# The location where the builds are checked and downloaded.
161161
remotelocation="vintagestory.at"
162162

163+
if [ "$(command -v jq 2> /dev/null)" ]; then
164+
fn_print_fail_nl "jq is not installed"
165+
fn_script_log_fatal "jq is not installed"
166+
core_exit.sh
167+
fi
168+
163169
if [ "${firstcommandname}" == "INSTALL" ]; then
164170
fn_update_remotebuild
165171
fn_update_dl

lgsm/modules/update_xnt.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ fn_update_compare() {
160160
# The location where the builds are checked and downloaded.
161161
remotelocation="github.com"
162162

163+
if [ "$(command -v jq 2> /dev/null)" ]; then
164+
fn_print_fail_nl "jq is not installed"
165+
fn_script_log_fatal "jq is not installed"
166+
core_exit.sh
167+
fi
168+
163169
if [ "${firstcommandname}" == "INSTALL" ]; then
164170
fn_update_remotebuild
165171
fn_update_dl

0 commit comments

Comments
 (0)