---
  # these are available from macos natively, but we want updated versions
  - name: install vim
    homebrew:
      name: vim

  - name: install zsh
    homebrew:
      name: zsh

  - name: init zsh
    shell: zsh -i -c "echo 'initializing zsh'"

  - name: fix zsh share permissions
    file:
      path: /usr/local/share/zsh
      recurse: yes
      mode: "g-w"


---
  # these are available from macos natively, but we want updated versions
  - name: install vim
    homebrew:
      name: vim

  - name: install zsh
    homebrew:
      name: zsh

  - name: init zsh
    shell: zsh -i -c "echo 'initializing zsh'"

  - name: check m1 homebrew
    stat:
      path: /usr/local/share
    register: usr_local_share

  - name: set homebrew share path
    set_fact: 
    homebrew_share: "{% if usr_local_share.stat.exists %}/usr/local/share{% else %}/opt/homebrew/share{% endif %}"

  - name: fix zsh share permissions
    file:
      path: "{{ homebrew_share }}/zsh"
      recurse: yes
      mode: "g-w"


Make zsh chmod aware of m1 vs x86 homebrew location
Make zsh chmod aware of m1 vs x86 homebrew location
