Move zsh install login into script
Enable installing zsh config repo standalone, i.e. without Ansible, invoke the `install.zsh` script instead.
This commit is contained in:
parent
dc6b7776ff
commit
d5fc2c3c13
@ -7,80 +7,10 @@
|
|||||||
dest: ~/.config/zsh
|
dest: ~/.config/zsh
|
||||||
version: main
|
version: main
|
||||||
|
|
||||||
- name: clone plugin repos
|
- name: run install script
|
||||||
git:
|
command: ~/.config/zsh/install.zsh
|
||||||
repo: '{{item.repo}}'
|
register: zsh_install
|
||||||
dest: '{{item.dest}}'
|
changed_when: "'changed' in zsh_install.stdout"
|
||||||
with_items:
|
|
||||||
- repo: https://github.com/zsh-users/zsh-autosuggestions.git
|
|
||||||
dest: ~/.config/zsh/zsh-autosuggestions
|
|
||||||
- repo: https://github.com/zsh-users/zsh-history-substring-search.git
|
|
||||||
dest: ~/.config/zsh/zsh-history-substring-search
|
|
||||||
- repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
|
|
||||||
dest: ~/.config/zsh/zsh-syntax-highlighting
|
|
||||||
- repo: https://github.com/zsh-users/zsh-completions.git
|
|
||||||
dest: ~/.config/zsh/zsh-completions
|
|
||||||
loop_control:
|
|
||||||
label: '{{item.repo | regex_search("https://github.com/(.*)\.git$", "\1")}}'
|
|
||||||
|
|
||||||
- name: create directories
|
|
||||||
file:
|
|
||||||
state: directory
|
|
||||||
dest: '{{item}}'
|
|
||||||
with_items:
|
|
||||||
- ~/.local/bin
|
|
||||||
- ~/.local/share/zsh/site-functions
|
|
||||||
|
|
||||||
- name: create symbolic links
|
|
||||||
file:
|
|
||||||
state: link
|
|
||||||
src: '{{item.src}}'
|
|
||||||
dest: '{{item.dest}}'
|
|
||||||
with_items:
|
|
||||||
- src: ~/.config/zsh/zlogin
|
|
||||||
dest: ~/.zlogin
|
|
||||||
- src: ~/.config/zsh/zlogout
|
|
||||||
dest: ~/.zlogout
|
|
||||||
- src: ~/.config/zsh/zprofile
|
|
||||||
dest: ~/.zprofile
|
|
||||||
- src: ~/.config/zsh/zshenv
|
|
||||||
dest: ~/.zshenv
|
|
||||||
- src: ~/.config/zsh/zshrc
|
|
||||||
dest: ~/.zshrc
|
|
||||||
- src: ~/.config/zsh/prompt_fresh_setup
|
|
||||||
dest: ~/.local/share/zsh/site-functions/prompt_fresh_setup
|
|
||||||
- src: ~/.config/zsh/build/_build-dir
|
|
||||||
dest: ~/.local/share/zsh/site-functions/_build-dir
|
|
||||||
- src: ~/.config/zsh/sandbox/_sandbox
|
|
||||||
dest: ~/.local/share/zsh/site-functions/_sandbox
|
|
||||||
- src: ~/.config/zsh/layout/_layout
|
|
||||||
dest: ~/.local/share/zsh/site-functions/_layout
|
|
||||||
- src: ~/.config/zsh/notes/_note
|
|
||||||
dest: ~/.local/share/zsh/site-functions/_note
|
|
||||||
- src: ~/.config/zsh/cmake-uninstall
|
|
||||||
dest: ~/.local/bin/cmake-uninstall
|
|
||||||
- src: ~/.config/zsh/$
|
|
||||||
dest: ~/.local/bin/$
|
|
||||||
- src: ~/.config/zsh/url/url
|
|
||||||
dest: ~/.local/bin/url
|
|
||||||
- src: ~/.config/zsh/url/_url
|
|
||||||
dest: ~/.local/share/zsh/site-functions/_url
|
|
||||||
|
|
||||||
loop_control:
|
|
||||||
label: '{{item.dest}}'
|
|
||||||
|
|
||||||
- name: list commands with available completions
|
|
||||||
command:
|
|
||||||
zsh {{ansible_env.HOME}}/.config/zsh/list-commands-with-available-completions.zsh
|
|
||||||
changed_when: false
|
|
||||||
register: completion_commands
|
|
||||||
|
|
||||||
- name: install completions for available commands
|
|
||||||
file:
|
|
||||||
state: link
|
|
||||||
src: '~/.config/zsh/zsh-completions/src/_{{item}}'
|
|
||||||
dest: '~/.local/share/zsh/site-functions/_{{item}}'
|
|
||||||
with_items: '{{completion_commands.stdout}}'
|
|
||||||
|
|
||||||
- name: get absolute path
|
- name: get absolute path
|
||||||
shell: command -v zsh
|
shell: command -v zsh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user