From 42b97f8ac9d1ba82a7c573dc9577274f6078e2be Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 9 Jun 2026 14:08:25 +0100 Subject: [PATCH] Also copy in worktree add/sycn local.bazelrc if present --- worktree/worktree.plugin.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/worktree/worktree.plugin.zsh b/worktree/worktree.plugin.zsh index 246ee6a..2283b7e 100644 --- a/worktree/worktree.plugin.zsh +++ b/worktree/worktree.plugin.zsh @@ -44,6 +44,9 @@ Manage git worktrees by branch name." _autoenv_authorized $wt_dest/.enter yes _autoenv_authorized $wt_dest/.exit yes fi + if [ -f $root/local.bazelrc ]; then + cp $root/local.bazelrc $wt_dest/local.bazelrc + fi ;; cd) @@ -170,6 +173,15 @@ Manage git worktrees by branch name." _autoenv_authorized "$wt_path/$f" yes print -P "%F{green}updated:%f $wt_path/$f" done + if [[ -f "$root/local.bazelrc" ]]; then + if [[ -L "$wt_path/local.bazelrc" ]]; then + rm "$wt_path/local.bazelrc" + elif [[ -f "$wt_path/local.bazelrc" ]] && cmp -s "$root/local.bazelrc" "$wt_path/local.bazelrc"; then + continue + fi + cp "$root/local.bazelrc" "$wt_path/local.bazelrc" + print -P "%F{green}updated:%f $wt_path/local.bazelrc" + fi done return $failed ;;