From be42c689c435eeaa25f9756b0e77ab36052cc835 Mon Sep 17 00:00:00 2001 From: Roma Sosnovsky Date: Wed, 8 Feb 2023 20:44:34 +0200 Subject: [PATCH 1/2] update build script --- scripts/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 8ad925184f5..be886f9dd4e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -70,7 +70,13 @@ mkdir -p $OUTDIR/lib/streams cp node_modules/@openpgp/web-stream-tools/lib/*.js $OUTDIR/lib/streams # patch imports with .js, e.g. replace './streams' with './streams.js' # until https://github.com/openpgpjs/web-stream-tools/pull/20 is resolved -sed -i.bak -E "s/'\.\/(streams|util|writer|reader|node-conversions)'/'\.\/\1\.js'/g" $OUTDIR/lib/streams/* +STREAMS_REGEX="s/'\.\/(streams|util|writer|reader|node-conversions)'/'\.\/\1\.js'/g" +STREAMS_OUTDIR=$OUTDIR/lib/streams/* +if [[ "$OSTYPE" =~ ^darwin ]]; then # macOS needs additional parameter for backup files + sed -i '' -E $STREAMS_REGEX $STREAMS_OUTDIR +else + sed -i -E $STREAMS_REGEX $STREAMS_OUTDIR +fi # to update node-forge library, which is missing the non-minified version in dist, we have to build it manually # cd ~/git && rm -rf ./forge && git clone https://github.com/digitalbazaar/forge.git && cd ./forge && npm install && npm run-script build From 003bfd60cae100a15e09695a1fbf453ebb7317ea Mon Sep 17 00:00:00 2001 From: Roma Sosnovsky Date: Thu, 9 Feb 2023 12:52:48 +0200 Subject: [PATCH 2/2] rename STREAMS_OUTDIR to STREAMS_FILES --- scripts/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index be886f9dd4e..f8853291e39 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -71,11 +71,11 @@ cp node_modules/@openpgp/web-stream-tools/lib/*.js $OUTDIR/lib/streams # patch imports with .js, e.g. replace './streams' with './streams.js' # until https://github.com/openpgpjs/web-stream-tools/pull/20 is resolved STREAMS_REGEX="s/'\.\/(streams|util|writer|reader|node-conversions)'/'\.\/\1\.js'/g" -STREAMS_OUTDIR=$OUTDIR/lib/streams/* +STREAMS_FILES=$OUTDIR/lib/streams/* if [[ "$OSTYPE" =~ ^darwin ]]; then # macOS needs additional parameter for backup files - sed -i '' -E $STREAMS_REGEX $STREAMS_OUTDIR + sed -i '' -E $STREAMS_REGEX $STREAMS_FILES else - sed -i -E $STREAMS_REGEX $STREAMS_OUTDIR + sed -i -E $STREAMS_REGEX $STREAMS_FILES fi # to update node-forge library, which is missing the non-minified version in dist, we have to build it manually