Three pre-WS-3 references purged: regex (apps/(app|portal)), grep (apps/(app|portal)), and the now-obsolete "apps/portal/ is planned but not present" defensive comment. The $spa variable becomes redundant with only one SPA — collapsed to direct apps/app/ references. Net: simpler script, no behavioural change for actual files in apps/app/ (still runs pnpm eslint --fix). Files outside apps/app/ were already a no-op.
25 lines
619 B
Bash
Executable File
25 lines
619 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
input="$(cat)"
|
|
path="$(echo "$input" | jq -r '.tool_input.file_path // .tool_input.path // empty')"
|
|
|
|
[ -z "$path" ] && exit 0
|
|
|
|
# Strip leading absolute prefix if present, so we match repo-relative paths.
|
|
rel="$path"
|
|
if [[ "$path" = /* ]]; then
|
|
rel="${path#$CLAUDE_PROJECT_DIR/}"
|
|
fi
|
|
|
|
# Match apps/app/** for .vue/.ts/.tsx/.js files.
|
|
if ! echo "$rel" | grep -Eq '^apps/app/.+\.(vue|ts|tsx|js)$'; then
|
|
exit 0
|
|
fi
|
|
|
|
# Path inside apps/app/.
|
|
inside="${rel#apps/app/}"
|
|
|
|
cd "$CLAUDE_PROJECT_DIR/apps/app" 2>/dev/null || exit 0
|
|
pnpm eslint --fix "$inside" >/dev/null 2>&1 || true
|
|
exit 0 |