diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 05:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 05:47:55 +0000 |
commit | 31d6ff6f931696850c348007241195ab3b2eddc7 (patch) | |
tree | 615cb1c57ce9f6611bad93326b9105098f379609 /tools/make-npm.sh | |
parent | Initial commit. (diff) | |
download | ublock-origin-31d6ff6f931696850c348007241195ab3b2eddc7.tar.xz ublock-origin-31d6ff6f931696850c348007241195ab3b2eddc7.zip |
Adding upstream version 1.55.0+dfsg.upstream/1.55.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | tools/make-npm.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tools/make-npm.sh b/tools/make-npm.sh new file mode 100755 index 0000000..6bffadc --- /dev/null +++ b/tools/make-npm.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# +# This script assumes a linux environment + +set -e + +DES="dist/build/uBlock0.npm" + +TMPDIR="$PWD/tmp" +mkdir -p "$TMPDIR/node_modules" + +rm -rf $DES + +./tools/make-nodejs.sh $DES +./tools/make-assets.sh $DES + +# Target-specific +cp platform/npm/.npmignore $DES/ +cp platform/npm/*.json $DES/ +cp platform/npm/.*.json $DES/ +cp platform/npm/*.js $DES/ +cp -R platform/npm/tests $DES/ + +cd $DES +cd tests/data +tar xzf bundle.tgz +cd - +npm run build +tarballname=$(npm pack 2> /dev/null) +if [ "$1" ]; then + echo "*** uBlock0.npm: Creating versioned package..." + mv $tarballname ../uBlock0_$1.npm.tgz +else + echo "*** uBlock0.npm: Creating plain package..." + mv $tarballname ../uBlock0.npm.tgz +fi +ln -sf "$TMPDIR/node_modules" +if [ -z "$GITHUB_ACTIONS" ]; then + npm install +fi +cd - + +echo "*** uBlock0.npm: Package done." |