From f733768388b4b31136a37e7a4eacc122280c24e9 Mon Sep 17 00:00:00 2001 From: Kyle Buller Date: Sun, 9 May 2021 11:38:19 -0500 Subject: [PATCH] Just use regex instead of extglob --- release.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/release.sh b/release.sh index ea9927a..59a2402 100755 --- a/release.sh +++ b/release.sh @@ -937,13 +937,15 @@ fi # Set the package name from a TOC file name if [[ -z "$package" ]]; then - toc_path=$( cd "$topdir" && find *.toc -maxdepth 0 2>/dev/null | head -n1 ) - if [[ -z "$toc_path" ]]; then + package=$( cd "$topdir" && find *.toc -maxdepth 0 2>/dev/null | head -n1 ) + if [[ -z "$package" ]]; then echo "Could not find an addon TOC file. In another directory? Set 'package-as' in .pkgmeta" >&2 exit 1 fi - package=${toc_path%.toc} - package=$( shopt -s extglob && echo "${package%-@(Mainline|Classic|BCC)}" ) + package=${package%.toc} + if [[ $package =~ ^(.*)-(Mainline|Classic|BCC)$ ]]; then + package="${BASH_REMATCH[1]}" + fi fi toc_path="$package.toc"