// blake_petersen

// install_context_view

Post-merge Dependency Sync Hook

Install context for /hooks/post-merge-dep-sync

run this command in your project root

$ blink apply post-merge-dep-sync

Writes this file into your project at .husky/post-merge. Existing files at those paths are replaced.

what gets written

// .husky/post-mergehusky/post-merge
set -e

# Files changed by this merge (ORIG_HEAD = pre-merge tip, HEAD = post-merge tip).
changed=$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD 2>/dev/null || echo "")

# grep -q instead of a case-glob — the literal asterisks in `*pnpm-lock.yaml*`
# get mangled into italics if a prettier pass ever touches this file.
if printf '%s\n' "$changed" | grep -q 'pnpm-lock\.yaml'; then
  echo "→ pnpm-lock.yaml changed — running pnpm install"
  if ! pnpm install; then
    echo "" >&2
    echo "✘ post-merge: pnpm install failed" >&2
    echo "  Your working tree is up-to-date, but node_modules is stale." >&2
    echo "  Run 'pnpm install' manually after fixing the error above." >&2
    exit 1
  fi
  echo "✓ post-merge: dependencies in sync"
fi