"Improved build scripts"

This commit is contained in:
Cris Stringfellow 2022-01-05 13:57:17 +08:00
parent 1099ab8e34
commit ef36b7bd0e
2 changed files with 7 additions and 7 deletions

View File

@ -25,8 +25,8 @@
"pkg": {
"patches": {
"./node_modules/fetch-blob/streams.cjs": [
"require('node:stream/web')",
"require('stream').web"
"Object.assign(globalThis, require('node:stream/web'))",
"Object.assign(globalThis, require('stream').web)"
]
},
"scripts": "build/*.js",

View File

@ -12,9 +12,9 @@ patch_required=$(grep -ER "require\([\"'](node:)?stream/web[\"']\)" node_modules
files=$(grep -rlER "require\([\"'](node:)?stream/web[\"']\)" node_modules/*)
if [[ ! -z "$patch_required" ]]; then
while IFS= read -r file; do
echo '--->' $file
grep -q $file package.json
if [ $? == 1 ]; then
#echo '--->' $file
#grep -q $file package.json
#if [ $? == 1 ]; then
echo '--->' $file "UNPATCHED!"
echo "Found an error!"
echo "Found something you need to patch before building"
@ -25,8 +25,8 @@ if [[ ! -z "$patch_required" ]]; then
echo "You need to add all these to pkg.patches to replace with require('stream').web"
./scripts/go_dev.sh
exit 1
fi
echo "OK"
#fi
#echo "OK"
done <<< $files
fi