Files
social-media/scripts/check-repo-hygiene.sh
Jonathan Bourdon c40653b2b7
All checks were successful
deploy-socialize / deploy (push) Successful in 8s
deploy-socialize / image (push) Successful in 32s
chore(ci): guards against tracked build artefacts
2026-05-05 23:41:20 -04:00

26 lines
684 B
Bash
Executable File

#!/usr/bin/env sh
set -eu
failed=0
tracked_build_outputs="$(git ls-files | grep -E '(^|/)([Bb]in|[Oo]bj)(/|\\)' || true)"
if [ -n "$tracked_build_outputs" ]; then
printf '%s\n' "Tracked build output paths found:" >&2
printf '%s\n' "$tracked_build_outputs" >&2
failed=1
fi
tracked_backslash_paths="$(git ls-files | grep '\\' || true)"
if [ -n "$tracked_backslash_paths" ]; then
printf '%s\n' "Tracked paths containing literal backslashes found:" >&2
printf '%s\n' "$tracked_backslash_paths" >&2
failed=1
fi
if [ "$failed" -ne 0 ]; then
printf '%s\n' "Remove generated files from Git before building." >&2
exit 1
fi
printf '%s\n' "Repository hygiene check passed."