diff --git a/hosts/pinwheel/modules/work/wt.zsh b/hosts/pinwheel/modules/work/wt.zsh index 803d757..04a3d66 100644 --- a/hosts/pinwheel/modules/work/wt.zsh +++ b/hosts/pinwheel/modules/work/wt.zsh @@ -98,9 +98,17 @@ _wt_dir() { } _wt_setup() { - local primary=$1 dir=$2 - if [[ -f $dir/.envrc && -f $primary/.envrc && "$(<$dir/.envrc)" == "$(<$primary/.envrc)" ]]; then - direnv allow "$dir" + local primary=$1 dir=$2 reply + if [[ -f $dir/.envrc ]]; then + if git -C "$dir" diff --quiet main -- .envrc; then + direnv allow "$dir" + else + print -r -- "wt: $dir/.envrc differs from main's:" + git --no-pager -C "$dir" diff main -- .envrc + read -q "reply?wt: allow it? [y/N] " + print + [[ $reply == y ]] && direnv allow "$dir" + fi fi if grep -qF 'file://%(buildroot)s/dist/' "$dir/pants.toml" 2>/dev/null; then print -r -- "[python-repos]