Use awk to make PV channel name

meow-7.2.2
Andrey Lihatskiy 2025-05-29 20:56:30 +03:00
parent bd7e79df36
commit 7aea88fb84
1 changed files with 3 additions and 1 deletions

View File

@ -218,8 +218,10 @@ jobs:
prefix=${ba[0]}
if [ "$prefix" == "project" ]; then
IFS='_' read -ra prj <<< "${ba[1]}"
prj_str="${prj[*]}"
# uppercase first letter of each word
export viewer_channel="Second Life Project ${prj[*]^}"
capitalized=$(echo "$prj_str" | awk '{for (i=1; i<=NF; i++) $i = toupper(substr($i,1,1)) substr($i,2); print}')
export viewer_channel="Second Life Project $capitalized"
elif [[ "$prefix" == "release" || "$prefix" == "main" ]];
then
export viewer_channel="Second Life Release"