Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit e588332

Browse files
authored
Merge pull request #222 from ni-fgenois/feature/update-global-when-inexistant
Set globals when the globals file doesn't exist
2 parents dfb8c76 + 7a172bd commit e588332

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tasks/install.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@
102102
- name: "Set pyenv global {{ pyenv_global }}"
103103
ansible.builtin.shell: . {{ pyenvrc_path }}/.pyenvrc && pyenv global {{ pyenv_global | join(' ') }} && pyenv rehash
104104
changed_when: true
105-
when:
106-
- _pyenv_globals_file.stat.exists
107-
- (_pyenv_globals_file_content.content | b64decode | split('\n') | select() | list) != pyenv_global
105+
when: >
106+
(
107+
_pyenv_globals_file.stat.exists
108+
and (_pyenv_globals_file_content.content | b64decode | split('\n') | select() | list) != pyenv_global
109+
)
110+
or not _pyenv_globals_file.stat.exists

0 commit comments

Comments
 (0)