Skip to content

Read the main checkout's .env.local from linked worktrees - #77

Merged
MarcusJRLee merged 2 commits into
mainfrom
worktree_env_local
Nov 16, 2026
Merged

MarcusJRLee merged 2 commits into
mainfrom
worktree_env_local

Conversation

@MarcusJRLee

@MarcusJRLee MarcusJRLee commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

The repo kit puts every branch in .worktrees/<name>, which has no .env.local, so scripts/install_app.sh refused to sign there unless you passed HC_ENV_FILE by hand.

  • New scripts/local_env.sh resolves, in order: HC_ENV_FILE, the checkout's own .env.local, then the main checkout's (found through git rev-parse --git-common-dir). Outside git it falls back to $PWD/.env.local.
  • install_app.sh and build_ios_device.sh use it, so iOS device installs from a worktree work too.
  • scripts/local_env_test.sh (run by check_fast.sh) covers the main checkout, a worktree with and without its own file, outside git, and the override.
  • README and the Builds and workflow record now describe the lookup.

Verification

  • scripts/check.sh: pass (includes install_app_test.sh and install_ios_test.sh).
  • Real path: scripts/install_app.sh from .worktrees/worktree_env_local with no HC_ENV_FILE signed, verified, installed, and passed the smoke and speech-service checks.
  • Docs and decision record updated.

Boundaries

  • No credentials or signing values; only the file's path is resolved.
  • Version/build metadata unchanged.
  • Apache 2.0.

Alternatives

Criterion Resolve via git --git-common-dir Copy .env.local into each worktree on checkout Require HC_ENV_FILE
One copy of private values 🟢 🔴 A copy per worktree 🟢
Works with no per-worktree step 🟢 🟡 Needs the setup hook 🔴 Manual every time
Override for tests 🟢 HC_ENV_FILE 🟡 🟢

Recommendation: resolve through the common git dir.

🤖 Generated with Claude Code

@MarcusJRLee
MarcusJRLee force-pushed the worktree_env_local branch 2 times, most recently from b84bdcb to 880ffba Compare November 11, 2026 03:44
@MarcusJRLee
MarcusJRLee force-pushed the worktree_env_local branch 2 times, most recently from 1f5b358 to 843f987 Compare November 16, 2026 18:37
MarcusJRLee and others added 2 commits November 16, 2026 16:33
The repo kit puts every branch in .worktrees/<name>, which has no
.env.local, so install_app.sh refused to sign there without HC_ENV_FILE.
scripts/local_env.sh resolves HC_ENV_FILE, then the checkout's own file,
then the main checkout's; install_app.sh and build_ios_device.sh use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MarcusJRLee
MarcusJRLee merged commit a9f9320 into main Nov 16, 2026
8 checks passed
@MarcusJRLee
MarcusJRLee deleted the worktree_env_local branch November 16, 2026 21:53
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