---
- name: Run task dependencies for install Hammerspoon
  include_tasks: "{{ playbook_dir }}/lib/dependencies/{{ item }}.yml"
  loop:
    - os_is_mac
    - homebrew_is_installed

- block:
    - name: Ensure Hammerspoon is installed and up to date
      homebrew_cask:
        name: hammerspoon
        state: upgraded

    - name: Create symlink for Hammerspoon configuration
      file:
        src: "{{ playbook_dir }}/modules/hammerspoon/settings"
        dest: ~/.hammerspoon
        state: link
  when:
      - os_is_mac
      - homebrew_is_installed

---
- name: Run task dependencies for install Hammerspoon
  include_tasks: "{{ playbook_dir }}/lib/dependencies/{{ item }}.yml"
  loop:
    - os_is_mac
    - homebrew_is_installed

- block:
    - name: Ensure Hammerspoon is installed and up to date
      homebrew_cask:
        name: hammerspoon
        state: upgraded

    - name: Create symlink for Hammerspoon configuration
      file:
        src: "{{ playbook_dir }}/modules/hammerspoon/settings"
        dest: ~/.hammerspoon
        state: link
        force: yes
  when:
      - os_is_mac
      - homebrew_is_installed

Apply force to link Hammerspoon settings folder
Apply force to link Hammerspoon settings folder
