---
- name: Tap Cask versions
  homebrew_tap: tap=caskroom/versions state=present

- name: Install apps
  homebrew_cask: name={{ item }} state=installed
  with_items: dotfiles.apps
  tags: apps

- name: Show ~/Library
  shell: chflags nohidden ~/Library
  changed_when: no

- name: Set defaults
  shell: '{{ item }}'
  with_items: osx.defaults
  changed_when: no

- name: Restart Finder
  shell: killall Finder

- name: Restart Dock
  shell: killall Dock

---
- name: Tap Cask versions
  homebrew_tap: tap=caskroom/versions state=present

- name: Install apps
  homebrew_cask: name={{ item }} state=installed
  with_items: dotfiles.apps or []
  tags: apps

- name: Show ~/Library
  shell: chflags nohidden ~/Library
  changed_when: no

- name: Set defaults
  shell: '{{ item }}'
  with_items: osx.defaults
  changed_when: no

- name: Restart Finder
  shell: killall Finder

- name: Restart Dock
  shell: killall Dock

Handle Homebrew Cask apps being nil
Handle Homebrew Cask apps being nil
