fix shellcheck warning

This commit is contained in:
tooomm
2026-07-26 13:09:24 +02:00
parent 065924a729
commit 176914c24b
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
#!/bin/bash
# fetch master branch
# Fetch master branch
git fetch origin master
# unshallow if needed
# Unshallow if needed
echo "Finding merge base"
if ! git merge-base origin/master HEAD; then
echo "Could not find merge base, unshallowing repo"
+2 -3
View File
@@ -7,8 +7,7 @@ version_line="$(grep 'INSERT INTO cockatrice_schema_version' servatrice/servatri
version_line="${version_line#*VALUES(}"
declare -i schema_ver="${version_line%%)*}"
# shellcheck disable=2012
latest_migration="$(ls -1 servatrice/migrations/ | tail -n1)"
latest_migration="$(printf '%s\n' servatrice/migrations/*.sql | sed 's#.*/##' | sort | tail -n1)"
xtoysql="${latest_migration#servatrice_}"
xtoy="${xtoysql%.sql}"
declare -i old_ver="10#${xtoy%_to_*}" # declare as integer with base 10, numbers with a leading 0 are normally interpreted as base 16
@@ -40,4 +39,4 @@ if ! grep -q "$expected_define" servatrice/src/servatrice_database_interface.h;
fi
echo " ✓ Database schema version is consistent"
echo "::endgroup::
echo "::endgroup::"