mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2025-01-09 04:27:35 +08:00
feat: add header to serverlist.csv (#4231)
* feat: add header to serverlist.csv added header to serverlistto help ansible and other tools better work with the csv file * feat: update serverlist menu The script now skips the first line of the serverlist file when generating the list for 'list' and 'install' commands. This ensures that the header is not included in the output. * fix: check details * fix serverlist validate test
This commit is contained in:
parent
fa24b08370
commit
2cebdfea66
@ -18,7 +18,7 @@ while read -r line; do
|
||||
echo -n "\"shortname\":" >> "shortnamearray.json"
|
||||
echo -n "\"${shortname}\"" >> "shortnamearray.json"
|
||||
echo -n "}," >> "shortnamearray.json"
|
||||
done < serverlist.csv
|
||||
done < <(tail -n +2 serverlist.csv)
|
||||
sed -i '$ s/.$//' "shortnamearray.json"
|
||||
echo -n "]" >> "shortnamearray.json"
|
||||
echo -n "}" >> "shortnamearray.json"
|
||||
|
2
.github/workflows/serverlist-validate.sh
vendored
2
.github/workflows/serverlist-validate.sh
vendored
@ -3,7 +3,7 @@ echo "Checking that all the game servers are listed in all csv files"
|
||||
echo "this check will ensure serverlist.csv has the same number of lines (-2 lines) as the other csv files"
|
||||
# count the number of lines in the serverlist.csv
|
||||
cd "lgsm/data" || exit
|
||||
serverlistcount="$(wc -l < serverlist.csv)"
|
||||
serverlistcount="$(tail -n +2 serverlist.csv | wc -l)"
|
||||
echo "serverlistcount: $serverlistcount"
|
||||
# get list of all csv files starting with ubunutu debian centos
|
||||
csvlist="$(ls -1 | grep -E '^(ubuntu|debian|centos|rhel|almalinux|rocky).*\.csv$')"
|
||||
|
@ -1,3 +1,4 @@
|
||||
shortname,gameservername,gamename,os
|
||||
ac,acserver,Assetto Corsa,ubuntu-22.04
|
||||
ahl,ahlserver,Action Half-Life,ubuntu-22.04
|
||||
ahl2,ahl2server,Action: Source,ubuntu-22.04
|
||||
|
|
@ -347,11 +347,11 @@ if [ "${shortname}" == "core" ]; then
|
||||
|
||||
if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then
|
||||
{
|
||||
tail -n +1 "${serverlist}" | awk -F "," '{print $2 "\t" $3}'
|
||||
tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}'
|
||||
} | column -s $'\t' -t | more
|
||||
exit
|
||||
elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then
|
||||
tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
|
||||
tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
|
||||
fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
|
||||
userinput="${result}"
|
||||
fn_server_info
|
||||
|
Loading…
Reference in New Issue
Block a user