The list is in config/redirectRules.ts (exact paths, from the old sitemap), written into dist/client by the build; check-artifact.sh requires it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
48 lines
1.0 KiB
Bash
48 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|
# Controle van de build voordat die wordt geüpload (BR-HST-15, FR-PR-17).
|
|
# Gebruik: check-artifact.sh <dist-map>
|
|
# Faalt als een verplicht bestand ontbreekt, als de servermap erin zit, of als
|
|
# er een source map in staat (die zou de broncode openbaar maken).
|
|
set -euo pipefail
|
|
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "Gebruik: $0 <dist-map>" >&2
|
|
exit 2
|
|
fi
|
|
dist="$1"
|
|
|
|
if [ ! -d "$dist" ]; then
|
|
echo "Geen map: $dist" >&2
|
|
exit 1
|
|
fi
|
|
|
|
failures=0
|
|
fail() {
|
|
echo "FOUT: $1" >&2
|
|
failures=$((failures + 1))
|
|
}
|
|
|
|
for file in index.html 404.html over-mij.html redirects.json; do
|
|
if [ -f "$dist/$file" ]; then
|
|
echo "gevonden: $file"
|
|
else
|
|
fail "$file ontbreekt in $dist"
|
|
fi
|
|
done
|
|
|
|
if [ -e "$dist/server" ]; then
|
|
fail "$dist/server bestaat: alleen de clientmap hoort online"
|
|
fi
|
|
|
|
maps="$(find "$dist" -type f -name '*.map')"
|
|
if [ -n "$maps" ]; then
|
|
fail "source maps gevonden:
|
|
$maps"
|
|
fi
|
|
|
|
if [ "$failures" -gt 0 ]; then
|
|
echo "Build geweigerd ($failures fout(en))" >&2
|
|
exit 1
|
|
fi
|
|
echo "Build in orde: $dist"
|