Skip to content

Commit

Permalink
Don't use char classes in awk
Browse files Browse the repository at this point in the history
mawk 1.3.3 uses a super old POSIX spec and is apparently still around.

Fixes #166
  • Loading branch information
nebularg committed May 31, 2024
1 parent 08d365a commit f3c020b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ set_info_toc_interface() {
sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | toc_filter alpha ${_tf_alpha:+true} | toc_filter debug true
)

toc_version=$( awk -F: '/^## Interface:/ { gsub(/[[:blank:]]/, "", $2); print $2; exit }' <<< "$toc_file" )
toc_version=$( awk -F: '/^## Interface:/ { gsub(/[ \t]/, "", $2); print $2; exit }' <<< "$toc_file" )
if [[ -n $toc_version ]]; then
local toc_version_game_type
IFS=',' read -ra V <<< "$toc_version"
Expand Down Expand Up @@ -1183,7 +1183,7 @@ set_info_toc_interface() {

# Save the game type interface values
for type in "${!game_flavor[@]}"; do
game_type_toc_version=$( awk -F: 'tolower($0) ~ /^## interface-'"$type"':/ { gsub(/[[:blank:]]/, "", $2); print $2; exit }' <<< "$toc_file" )
game_type_toc_version=$( awk -F: 'tolower($0) ~ /^## interface-'"$type"':/ { gsub(/[ \t]/, "", $2); print $2; exit }' <<< "$toc_file" )
if [[ -n $game_type_toc_version ]]; then
type="${game_flavor[$type]}"
IFS=',' read -ra V <<< "$game_type_toc_version"
Expand Down Expand Up @@ -1220,7 +1220,7 @@ set_info_toc_interface() {
*) game_type_toc_prefix=
esac
if [[ -n $game_type_toc_prefix ]]; then
toc_version=$( sed -n '/@non-[-a-z]*@/,/@end-non-[-a-z]*@/{//b;p}' <<< "$toc_file" | awk -F: '/#[[:blank:]]*## Interface:[[:blank:]]*('"$game_type_toc_prefix"')/ { gsub(/[[:blank:]]/, "", $2); print $2; exit }' )
toc_version=$( sed -n '/@non-[-a-z]*@/,/@end-non-[-a-z]*@/{//b;p}' <<< "$toc_file" | awk -F: '/#[ \t]*## Interface:[ \t]*('"$game_type_toc_prefix"')/ { gsub(/[ \t]/, "", $2); print $2; exit }' )
IFS=',' read -ra V <<< "$toc_version"
for i in "${V[@]}"; do
toc_to_type "$i" "toc_file_game_type"
Expand Down Expand Up @@ -1257,13 +1257,13 @@ set_toc_project_info() {
fi
# Get project IDs for uploading
if [ -z "$slug" ]; then
slug=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk -F: '/^## X-Curse-Project-ID:/ { gsub(/[[:blank:]]/, "", $2); print $2; exit }' )
slug=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk -F: '/^## X-Curse-Project-ID:/ { gsub(/[ \t]/, "", $2); print $2; exit }' )
fi
if [ -z "$addonid" ]; then
addonid=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk -F: '/^## X-WoWI-ID:/ { gsub(/[[:blank:]]/, "", $2); print $2; exit }' )
addonid=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk -F: '/^## X-WoWI-ID:/ { gsub(/[ \t]/, "", $2); print $2; exit }' )
fi
if [ -z "$wagoid" ]; then
wagoid=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk -F: '/^## X-Wago-ID:/ { gsub(/[[:blank:]]/, "", $2); print $2; exit }' )
wagoid=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk -F: '/^## X-Wago-ID:/ { gsub(/[ \t]/, "", $2); print $2; exit }' )
fi
}

Expand Down

0 comments on commit f3c020b

Please sign in to comment.