Skip to content

fix: guard prepare script against non-git environments#12

Merged
saskim merged 1 commit into
mainfrom
fix/prepare-script-docker
May 14, 2026
Merged

fix: guard prepare script against non-git environments#12
saskim merged 1 commit into
mainfrom
fix/prepare-script-docker

Conversation

@saskim

@saskim saskim commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • The prepare script unconditionally ran git config core.hooksPath .githooks, causing Railway Docker builds to fail with fatal: not in a git directory
  • Guards the command with git rev-parse --git-dir so it only runs inside a real git repo; exits 0 otherwise
  • Local dev workflow is unaffected — hooks still activate after pnpm install

Test plan

  • Railway build succeeds (no more fatal: not in a git directory error during pnpm build)
  • pnpm install locally still activates git hooks (verify .githooks/ is wired via git config core.hooksPath)
  • CI passes (lint → build → tests)

🤖 Generated with Claude Code

The prepare script was calling `git config core.hooksPath` unconditionally,
which caused Railway Docker builds to fail with "fatal: not in a git directory".
Now skips the git config step when not inside a git repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@saskim saskim merged commit 57cc550 into main May 14, 2026
1 check passed
@saskim saskim deleted the fix/prepare-script-docker branch May 14, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant