From 46995767c816136604837d71ca0a3c300a833ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20L=C3=B6fgren?= Date: Sat, 3 Feb 2024 15:02:25 +0100 Subject: [PATCH] ext: target never contains slash at the end --- wikiweaver-ext/build.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wikiweaver-ext/build.sh b/wikiweaver-ext/build.sh index 7aac84d..800bbef 100755 --- a/wikiweaver-ext/build.sh +++ b/wikiweaver-ext/build.sh @@ -18,7 +18,11 @@ while test $# -gt 0; do print_help_text exit 0 ;; - firefox | firefox/ | chrome | chrome/) + firefox/ | chrome/) + TARGET=${1%/} + shift + ;; + firefox | chrome) TARGET=$1 shift ;; @@ -41,12 +45,12 @@ if [[ -z $TARGET ]]; then fi BUILD_BASE="./build" -BUILD_TARGET="$BUILD_BASE/$TARGET" +BUILD_TARGET="$BUILD_BASE/$TARGET/" rm -rdf $BUILD_TARGET mkdir -p $BUILD_TARGET -cp -r common/* $BUILD_TARGET/ +cp -r common/* $BUILD_TARGET cp -r $TARGET/* $BUILD_TARGET echo "Created extension in $BUILD_TARGET" @@ -54,6 +58,6 @@ echo "Created extension in $BUILD_TARGET" if [[ -n $PACKAGE_VERSION ]]; then PACKAGE_FILE="$BUILD_BASE/wikiweaver-ext-v$PACKAGE_VERSION-$TARGET.zip" zip -qr $PACKAGE_FILE $BUILD_TARGET - + echo "Packaged extension in $PACKAGE_FILE" fi