.gear/generate: Raise audit level and log build

`--audit-level=critical` only affects exit code, not the level of fix.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Vitaly Chikunov 2025-10-13 01:32:40 +03:00
parent 3e173ec7dc
commit 62eecdf684

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Re-generate React index.html.gz for llama-server
cd "$(git rev-parse --show-toplevel)"
@ -8,16 +8,18 @@ hsh --ini
hsh-install git npm
hsh-copy . build
hsh-run --rooter -- bash -c 'echo nameserver 1.1.1.1 > /etc/resolv.conf'
f=tools/server/public/index.html.gz
printf '%s\n\n' "ALT: Re-generate $f" > .git/NPM_I.log
share_network=1 \
hsh-run --mountpoints=/proc -- bash -xe <<-EOF
hsh-run --mountpoints=/proc -- bash -e <<-EOF |& tee -a .git/NPM_I.log
cd /usr/src/build
set -x
cd tools/server/webui
npm i
npm audit fix
npm audit --audit-level=critical fix
du -sh node_modules
npm run build
EOF
f=tools/server/public/index.html.gz
hsh-run -- base64 "/usr/src/build/$f" | base64 -d > "$f"
git add "$f"
git diff --cached --quiet || git commit -m "ALT: Re-generate $f"
git diff --cached --quiet || git commit -F .git/NPM_I.log