todo-app/scripts/check_home_paths.sh
Krzysztof kuhy Rudnicki 753e410fb4
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
Export the backlog to ~/src/todo, not the pre-reorganisation ~/todo
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-12 17:13:21 +02:00

35 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# Fail if code builds a ~/<name> path that ~ is not allowed to contain.
#
# Thin delegate to the shared gate in ~/src/utils, which owns the eleven
# allowed root entries and the exclusion list. Copying that logic here is what
# lets one repo's idea of the layout drift from every other repo's -- so this
# script only locates the shared checker and forwards its arguments.
#
# Why it exists: the 2026-09-11 reorganisation's rewriter matched *literal*
# /home/kuhy/<name> strings, so a path assembled at run time was invisible to
# it. The todo desktop wrapper went on exporting to a dead ~/todo for a day
# while its MCP read ~/src/todo, and every backlog read in between was stale.
#
# Usage:
# scripts/check_home_paths.sh <file> [<file> ...] # pre-commit passes these
# scripts/check_home_paths.sh --all [<root>] # whole tree, default cwd
# ============================================================================
set -euo pipefail
readonly SHARED_GATE="${UTILS_ROOT:-$HOME/src/utils}/scripts/check_home_paths.sh"
main() {
if [[ ! -x "$SHARED_GATE" ]]; then
echo "Error: shared gate not found at $SHARED_GATE" >&2
echo "Clone kuhyx/utils to ~/src/utils, or set UTILS_ROOT." >&2
exit 1
fi
exec "$SHARED_GATE" "$@"
}
main "$@"