From 1a806308528517fa056f1bada41778fbb305cad3 Mon Sep 17 00:00:00 2001 From: "Armen Zambrano G." <44410+armenzg@users.noreply.github.com> Date: Wed, 27 May 2026 11:34:08 -0400 Subject: [PATCH] chore(devenv): add worktree bootstrap helper script Add a single-command setup helper for newly created git worktrees so developers can run devenv sync before invoking Makefile targets. Co-Authored-By: Codex Co-authored-by: Cursor --- README.md | 10 ++++++++++ scripts/setup-worktree.sh | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 scripts/setup-worktree.sh diff --git a/README.md b/README.md index a9622ad1..c577662c 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,16 @@ pull requests. You'll need a local clone of this repository to start. +### New worktrees + +For a newly created git worktree, bootstrap the local environment before running `make`: + +```shell +./scripts/setup-worktree.sh +``` + +This runs `devenv sync` for the worktree and (when installed) enables direnv for the repo. + ### Python From the root of `sentry-protos` run: diff --git a/scripts/setup-worktree.sh b/scripts/setup-worktree.sh new file mode 100755 index 00000000..4abb0f03 --- /dev/null +++ b/scripts/setup-worktree.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if ! command -v devenv >/dev/null 2>&1; then + echo "devenv is required to bootstrap this worktree." >&2 + echo "Install instructions: https://github.com/getsentry/devenv#install" >&2 + exit 1 +fi + +repo_root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" +cd "${repo_root}" + +echo "Bootstrapping sentry-protos worktree at ${repo_root}" +devenv sync + +if command -v direnv >/dev/null 2>&1 && [ -f .envrc ]; then + direnv allow "${repo_root}" >/dev/null 2>&1 || true +fi + +echo "Worktree setup complete."