|
754 | 754 |
|
755 | 755 | # Variables set via .pkgmeta.
|
756 | 756 | package=
|
| 757 | +project= |
757 | 758 | manual_changelog=
|
758 | 759 | changelog=
|
759 | 760 | changelog_markup="text"
|
@@ -961,8 +962,8 @@ if [ -f "$pkgmeta_file" ]; then
|
961 | 962 | ;;
|
962 | 963 | move-folders)
|
963 | 964 | # Save project root directories
|
964 |
| - _mf_path="${yaml_key#*/}" # strip the package name |
965 | 965 | if [[ $yaml_value != *"/"* ]]; then
|
| 966 | + _mf_path="${yaml_key#*/}" # strip the package name |
966 | 967 | toc_root_paths["$topdir/$_mf_path"]="$yaml_value"
|
967 | 968 | fi
|
968 | 969 | ;;
|
@@ -1183,10 +1184,27 @@ if [[ -z "$package" ]]; then
|
1183 | 1184 | fi
|
1184 | 1185 | fi
|
1185 | 1186 |
|
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 |
1188 | 1206 |
|
1189 |
| -# Parse the main addon's TOC file(s) |
| 1207 | +# Parse move-folder TOC files |
1190 | 1208 | for path in "${!toc_root_paths[@]}"; do
|
1191 | 1209 | for toc_path in "$path/${toc_root_paths[$path]}"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC}.toc; do
|
1192 | 1210 | if [[ -f "$toc_path" ]]; then
|
|
0 commit comments