fix: Use idempotent command for moving files and directories
This commit is contained in:
@@ -81,8 +81,8 @@
|
||||
- { src: '.myclirc', dest: '.config/mycli/myclirc' }
|
||||
- { src: '.tig_history', dest: '.local/share/tig/history' }
|
||||
|
||||
- name: Move file or directory
|
||||
command: "mv {{ home_dir }}/{{ item.item.src }} {{ home_dir }}/{{ item.item.dest }}"
|
||||
- name: Move file or directory using shell for idempotency
|
||||
shell: "cp -aT '{{ home_dir }}/{{ item.item.src }}' '{{ home_dir }}/{{ item.item.dest }}' && rm -rf '{{ home_dir }}/{{ item.item.src }}'"
|
||||
when: item.stat.exists
|
||||
loop: "{{ stat_result.results }}"
|
||||
loop_control:
|
||||
|
||||
Reference in New Issue
Block a user