Revert "refactor: improve direnv installer"

This reverts commit f9868fd388.
This commit is contained in:
Price Hiller 2022-08-03 01:35:21 -05:00
parent f9868fd388
commit 9872fbdaf7

View File

@ -1,25 +1,22 @@
--- ---
- name: Check if direnv installed - name: Install direnv for Arch
ansible.builtin.stat: community.general.pacman:
path: "{{ xdg_bin_home }}/direnv" name:
register: direnv_installed - direnv
changed_when: false state: present
when: ansible_facts.distribution == 'Archlinux'
- name: Create direnv working dir - name: Install direnv for Debian based systems
ansible.builtin.tempfile: become: true
state: directory ansible.builtin.apt:
register: direnv_work_dir name:
when: not direnv_installed.stat.exists - direnv
state: present
when: ansible_facts.os_family == 'Debian'
- name: Download direnv installer script - name: Install direnv for MacOS
ansible.builtin.get_url: community.general.homebrew:
url: https://direnv.net/install.sh name:
dest: "{{ direnv_work_dir.path }}/install.sh" - direnv
mode: 744 state: present
when: not direnv_installed.stat.exists when: ansible_facts.distribution == 'MacOSX'
- name: Install direnv
ansible.builtin.command: "bash {{ direnv_work_dir.path }}/install.sh"
environment:
bin_path: "{{ xdg_bin_home }}"
when: not direnv_installed.stat.exists