From 96271783e159decef3475eaff46607247b0bdd55 Mon Sep 17 00:00:00 2001 From: R-J Lim Date: Sat, 4 May 2024 11:42:26 -0700 Subject: [PATCH] package script zips without top-level directory - Makes the zip file drag-and-droppable into chrome --- scripts/package | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/package b/scripts/package index 8a60dc56..4811b198 100755 --- a/scripts/package +++ b/scripts/package @@ -13,20 +13,18 @@ fi PLATFORM=$1 SCRIPTPATH="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)" -DISTPATH=$SCRIPTPATH/../extension/dist +DISTPATH=$SCRIPTPATH/../extension/dist/$PLATFORM pushd $DISTPATH -NAME="asbplayer-extension-$(jq -r .version $PLATFORM/manifest.json)-$PLATFORM.zip" - -# Remove old zip file -rm -f $NAME +NAME="asbplayer-extension-$(jq -r .version manifest.json)-$PLATFORM.zip" # Force file timestamps to constant so that final zip is deterministic -find $PLATFORM -mindepth 1 | xargs touch -ad "1970-01-01T00:00:00" -find $PLATFORM -mindepth 1 | xargs touch -md "1970-01-01T00:00:00" +find . -mindepth 1 | xargs touch -ad "1970-01-01T00:00:00" +find . -mindepth 1 | xargs touch -md "1970-01-01T00:00:00" # Zip everything up -find $PLATFORM -mindepth 1 | xargs zip -X $NAME $PLATFORM/* +rm -f ../$NAME +find . -mindepth 1 | xargs zip -X ../$NAME popd