Skip to content

Commit

Permalink
Install diff-so-fancy
Browse files Browse the repository at this point in the history
  • Loading branch information
Encephala committed Jun 20, 2024
1 parent 70be9b7 commit aaccb7a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions roles/provision/files/git/dotgitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
defaultBranch = main
[core]
editor = vim
pager = "diff-so-fancy | less --tabs=4 -RF"
[interactive]
diffFilter = "diff-so-fancy --patch"
16 changes: 12 additions & 4 deletions roles/provision/tasks/dotfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
- name: Install ohmyzsh

Check failure on line 40 in roles/provision/tasks/dotfiles.yml

View workflow job for this annotation

GitHub Actions / Ansible lint

command-instead-of-module

curl used in place of get_url or uri module
ansible.builtin.shell:
# Yoinked from https://github.com/ThePrimeagen/ansible/blob/master/tasks/zsh-setup.yml
cmd: curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh > /tmp/oh-my-installer && chmod +x /tmp/oh-my-installer && /tmp/oh-my-installer
cmd: "curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh > /tmp/oh-my-installer\
&& chmod +x /tmp/oh-my-installer\
&& /tmp/oh-my-installer"
creates: "{{ home }}/.oh-my-zsh"

# Theme is configured in .zshrc
Expand All @@ -49,13 +51,12 @@
ansible.builtin.git:
repo: https://github.com/Encephala/alien.git
dest: "{{ home }}/.alien"
accept_hostkey: true
depth: 1

- name: Check user's shell
ansible.builtin.command: grep "^jonathan.*zsh.*" /etc/passwd
register: user_shell
changed_when: no
changed_when: false
failed_when: user_shell.stderr != ""

- name: Change shell to zsh
Expand All @@ -76,7 +77,7 @@

- name: Install rust with Rustup
ansible.builtin.shell:
cmd: curl https://sh.rustup.rs -sSf | sh -s -- -y
cmd: set -o pipefail curl https://sh.rustup.rs -sSf | sh -s -- -y
creates: "{{ home }}/.cargo"

- name: Install zoxide
Expand All @@ -87,6 +88,13 @@
environment:
PATH: "{{ home }}/.cargo/bin:{{ lookup('ansible.builtin.env', 'PATH') }}"

- name: Install diff-so-fancy
ansible.builtin.git:
repo: https://github.com/so-fancy/diff-so-fancy.git
dest: "{{ home }}/.oh-my-zsh/custom/plugins/diff-so-fancy"
depth: 1


- name: Copy .gitconfig
ansible.builtin.copy:
src: git/dotgitconfig
Expand Down

0 comments on commit aaccb7a

Please sign in to comment.