chore(submodules): record the-order + smom artifact hygiene; add surgical clean helper
- Bump the-order to drop tracked tsc output under packages/*/src (dist is canonical). - Bump smom-dbis-138 to gitignore/untrack Foundry artifacts/. - submodules-clean: print dirty count and names first. - scripts/maintenance/surgical-clean-submodule-artifacts.sh for repeat idempotent cleanup. Made-with: Cursor
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
# Exit 0 if every submodule has a clean working tree (no modified/untracked files).
|
||||
# Use in CI or after merges: bash scripts/verify/submodules-clean.sh
|
||||
# Set SKIP_EXIT=1 to report dirty submodules without failing.
|
||||
#
|
||||
# Common fix (TypeScript monorepos): compiler output in packages/*/src/*.js — belongs in dist/;
|
||||
# see the-order/.gitignore pattern and SUBMODULE_HYGIENE.md.
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
cd "$ROOT"
|
||||
@@ -11,6 +14,7 @@ tmp="$(mktemp)"
|
||||
trap 'rm -f "$tmp"' EXIT
|
||||
|
||||
dirty=0
|
||||
dirty_names=()
|
||||
while IFS= read -r subpath; do
|
||||
[[ -z "$subpath" ]] && continue
|
||||
if ! git -C "$ROOT/$subpath" rev-parse --git-dir >/dev/null 2>&1; then
|
||||
@@ -19,12 +23,14 @@ while IFS= read -r subpath; do
|
||||
out="$(git -C "$ROOT/$subpath" status --porcelain 2>/dev/null || true)"
|
||||
if [[ -n "$out" ]]; then
|
||||
dirty=1
|
||||
dirty_names+=("$subpath")
|
||||
printf '%s\n' "=== $subpath ===" >>"$tmp"
|
||||
printf '%s\n' "$out" >>"$tmp"
|
||||
fi
|
||||
done < <(git config --file .gitmodules --get-regexp '^submodule\..*\.path$' | awk '{print $2}' | sort -u)
|
||||
|
||||
if (( dirty )); then
|
||||
echo "submodules-clean: ${#dirty_names[@]} dirty submodule(s): ${dirty_names[*]}" >&2
|
||||
echo "submodules-clean: dirty submodule working trees:" >&2
|
||||
cat "$tmp" >&2
|
||||
if [[ "$SKIP_EXIT" != "1" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user