Skip to content

Commit

Permalink
package script zips without top-level directory
Browse files Browse the repository at this point in the history
- Makes the zip file drag-and-droppable into chrome
  • Loading branch information
killergerbah committed May 4, 2024
1 parent 7f93cd8 commit 9627178
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9627178

Please sign in to comment.