Skip to content

Commit d277afb

Browse files
committed
feat: support install pre-commit without kayobe-venv
1 parent 54766db commit d277afb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

etc/kayobe/ansible/install-pre-commit-hooks.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
ansible.builtin.pip:
1212
name: pre-commit
1313
version: "{{ pre_commit_version }}"
14-
virtualenv: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}"
14+
virtualenv: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') | default(omit, true) }}"
1515
register: pip_install
1616

1717
- name: Register pre-commit hooks with git
1818
ansible.builtin.command:
19-
cmd: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/bin/pre-commit install"
19+
cmd: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') | default(lookup('ansible.builtin.env', 'HOME') ~ '/.local', true) }}/bin/pre-commit install"
2020
args:
21-
chdir: "{{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}"
22-
when: pip_install is changed
21+
chdir: "{{ playbook_dir | dirname | dirname | dirname }}"

0 commit comments

Comments
 (0)