From d5216a045ddff81babdcdaaea003de042c8eb898 Mon Sep 17 00:00:00 2001 From: Max Hohlfeld Date: Wed, 16 Aug 2023 21:23:39 +0200 Subject: [PATCH] refactor: improve typing speed for justfile --- justfile | 9 +++++++++ roles/git/tasks/main.yml | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index f81ae37..90b32e2 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,5 @@ allTags := "nvim,xmonad,git,scripts" +hostname := `cat /etc/hostname` default: just --list @@ -6,6 +7,14 @@ default: install-dependencies: ansible-galaxy collection install kewlfft.aur +alias s := setup +setup tags=allTags: + just setup-{{ if hostname == "qwerty" { "qwerty" } else if hostname == "LE-ARCH-MHO" { "t460p" } else { "x220" } }} "{{ tags }}" + +alias c := config +config tags=allTags: + just config-{{ if hostname == "qwerty" { "qwerty" } else if hostname == "LE-ARCH-MHO" { "t460p" } else { "x220" } }} "{{ tags }}" + setup-qwerty tags=allTags: ansible-playbook site.yml -K -t "pc,qwerty,{{tags}}" diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 6ad9e06..5c66185 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -7,14 +7,14 @@ - lazygit state: present become: true - tags: pc + tags: [pc, setup] - name: Create a config directory if it doesn't exist ansible.builtin.file: path: ~/.config/git state: directory mode: '0755' - tags: pc + tags: [pc, setup] - name: Copy over config for T460p ansible.builtin.copy: @@ -35,7 +35,7 @@ path: ~/.config/lazygit state: directory mode: '0755' - tags: pc + tags: [pc, setup] - name: Copy over config for lazygit ansible.builtin.copy: