File update.sh of Package draupnir
#!/bin/sh -Cefux
# Exit early on missing requirements
if ! which corepack22 node yarn make cc g++ tsc
then
echo "Missing build requirements"
exit 1
fi
rm -fr Draupnir
osc service ra
cd Draupnir
yarn install || :
cd ..
test -d tmp || mkdir tmp
cd tmp
npm i node-gyp
node_gyp="$(realpath node_modules/.bin/node-gyp)"
cd ../Draupnir/node_modules/better-sqlite3
$node_gyp configure
$node_gyp build --release
cd ../..
yarn build
find node_modules -type d \( -name scripts -o -name test \) -prune -execdir rm -r {} +
find node_modules -type d -name .\* -not -name .bin -prune -execdir rm -r {} +
find node_modules -type f -name .\* -delete
find node_modules -type f \( -name \*.bak -o -name \*.swp \) -delete
find node_modules -type f -size 0 -delete
find node_modules -type f -name README.md -delete # wrong line endings, likely not needed anyways
find node_modules -type f -name '*sh_completion*' -delete
find node_modules -type f \( -name \*.a -o -name \*.cpp -o -name \*.c -o -name \*.h -o -name \*.hpp \) -delete
rm node_modules/better-sqlite3/deps/download.sh
rm -r node_modules/better-sqlite3/build/Release/obj.target
find . -type f -execdir chmod -x {} +
tar --zstd -cf ../vendor.tar.zst node_modules lib version.txt