Skip to content

Commit 8a0c3a6

Browse files
committed
Parse root toc for package info first
1 parent 28e9c51 commit 8a0c3a6

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

release.sh

+22-4
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,7 @@ fi
754754

755755
# Variables set via .pkgmeta.
756756
package=
757+
project=
757758
manual_changelog=
758759
changelog=
759760
changelog_markup="text"
@@ -961,8 +962,8 @@ if [ -f "$pkgmeta_file" ]; then
961962
;;
962963
move-folders)
963964
# Save project root directories
964-
_mf_path="${yaml_key#*/}" # strip the package name
965965
if [[ $yaml_value != *"/"* ]]; then
966+
_mf_path="${yaml_key#*/}" # strip the package name
966967
toc_root_paths["$topdir/$_mf_path"]="$yaml_value"
967968
fi
968969
;;
@@ -1183,10 +1184,27 @@ if [[ -z "$package" ]]; then
11831184
fi
11841185
fi
11851186

1186-
# Add the project root
1187-
toc_root_paths["$topdir"]="$package"
1187+
# Parse the project root TOC file for info first
1188+
for toc_path in "$topdir/$package"{,"/$package"}{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC}.toc; do
1189+
if [[ -f "$toc_path" ]]; then
1190+
if [ -z "$project" ]; then
1191+
project=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk '/^## Title:/ { print $0; exit }' | sed -e 's/|c[0-9A-Fa-f]\{8\}//g' -e 's/|r//g' -e 's/|T[^|]*|t//g' -e 's/## Title[[:space:]]*:[[:space:]]*\(.*\)/\1/' -e 's/[[:space:]]*$//' )
1192+
fi
1193+
if [ -z "$slug" ]; then
1194+
slug=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk '/^## X-Curse-Project-ID:/ { print $NF; exit }' )
1195+
fi
1196+
if [ -z "$addonid" ]; then
1197+
addonid=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk '/^## X-WoWI-ID:/ { print $NF; exit }' )
1198+
fi
1199+
if [ -z "$wagoid" ]; then
1200+
wagoid=$( sed -e $'1s/^\xEF\xBB\xBF//' -e $'s/\r//g' "$toc_path" | awk '/^## X-Wago-ID:/ { print $NF; exit }' )
1201+
fi
1202+
# Add the root TOC file for interface parsing
1203+
toc_root_paths["${toc_path%/*}"]="$package"
1204+
fi
1205+
done
11881206

1189-
# Parse the main addon's TOC file(s)
1207+
# Parse move-folder TOC files
11901208
for path in "${!toc_root_paths[@]}"; do
11911209
for toc_path in "$path/${toc_root_paths[$path]}"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC}.toc; do
11921210
if [[ -f "$toc_path" ]]; then

0 commit comments

Comments
 (0)