Dot_Files/roles/zsh/tasks/install-autojump.yml

40 lines
1.1 KiB
YAML

---
- name: Set Autojump install path if not set
ansible.builtin.set_fact:
auto_jump_install_path: "{{ xdg_data_home + '/autojump' }}"
when: auto_jump_install_path is not defined
- name: Check if Autojump Installed
ansible.builtin.stat:
path:
register: autojump_installed
- name: Set Autojump git destination
ansible.builtin.set_fact:
autojump_git_dest: /tmp/autojump
- name: Get Autojump from Git
ansible.builtin.git:
repo: "{{ autojump_git_repo | default('https://github.com/wting/autojump.git') }}"
dest: "{{ autojump_git_dest }}"
version: "{{ autojump_git_version | default('release-v22.5.3') }}"
force: true
when: not autojump_installed.stat.exists
- name: Install Autojump
ansible.builtin.command:
argv:
- python3
- "{{ autojump_git_dest }}/install.py"
- -d
- "{{ auto_jump_install_path }}"
changed_when: true
when: not autojump_installed.stat.exists
- name: Ensure Autojump Uses Python3
ansible.builtin.lineinfile:
path: "{{ auto_jump_install_path }}/bin/autojump"
regexp: "#!.* python$"
line: "#!/usr/bin/env python3"
when: not autojump_installed.stat.exists