Update dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiremove, dotfiles/.local/share/chezmoi/home/dot_local/bin/executable_tinypng.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl

This commit is contained in:
Brian Zalewski 2022-11-29 03:00:23 +00:00
parent fc5e81103d
commit 589072562b
4 changed files with 24 additions and 7 deletions

View file

@ -171,6 +171,7 @@ data:
SNAPCRAFT_EMAIL: "{{ $email }}"
TABBY_CONFIG_ID: "{{ $tabbyConfigId }}"
TABBY_SYNC_TOKEN: "{{ $tabbySyncToken }}"
TINYPNG_API_KEY: "g355tx7dxG5yJfl0RXJnpQlQqk88dJBv"
diff:
format: "git"
pager: "delta"

View file

@ -11,15 +11,26 @@ Brewfile
.gradle
.inputrc
.krew
.lesshst
.m2
.npmrc
.pip
.pnpm-state/
.profile
.python_history
.rustup
.subversion
.tinypng
.tmux.conf
.tmux.conf.local
.v8flags*
.vagrant.d/
.viminfo
.wgetrc
.wget-hsts
.zlogin
.zlogout
.zsh_history
.zsh_sessions
.zprofile
.zshrc.zwc

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
tinypng -k {{ .user.TINYPNG_API_KEY }} $@

View file

@ -2,7 +2,7 @@
### Symlink the variables / files / inventories to ~/.config/ansible folders if they are present
### i.e. Changes to upstream will not impact the play if your configuration files are stored locally
for TARGET of "files" "group_vars" "host_vars" "inventories" "templates"; do
for TARGET in "files" "group_vars" "host_vars" "inventories" "templates"; do
if [ -d "$HOME/.config/ansible/$TARGET" ] && [ "$(readlink -f "$HOME/.local/share/ansible/$TARGET")" != "$HOME/.config/ansible/$TARGET" ]; then
logg 'Symlinking Ansible playbook `'"$TARGET"'` to ~/.config/ansible/$TARGET'
rm -f "$HOME/.local/share/ansible/$TARGET"
@ -13,9 +13,11 @@ done
### Symlink tasks as well
### Note: Only handles tasks one level deep (i.e. ~/.config/ansible/tasks/my-task.yml will link to the tasks folder
### but ~/.config/ansible/tasks/directory/my-other-task.yml will not)
find "$HOME/.config/ansible/tasks" -type f | while read TASK_FILE; do
TASK_FILE_NAME="$(echo "$TASK_FILE" | sed 's/.*\/\([^\/]*\)$/\1/')"
if [ "$(readlink -f "$HOME/.local/share/ansible/tasks/$TASK_FILE_NAME")" != "$TASK_FILE" ]; then
ln -s "$TASK_FILE" "$HOME/.local/share/ansible/tasks/$TASK_FILE_NAME"
fi
done
if [ -d "$HOME/.config/ansible/tasks" ]; then
find "$HOME/.config/ansible/tasks" -type f | while read TASK_FILE; do
TASK_FILE_NAME="$(echo "$TASK_FILE" | sed 's/.*\/\([^\/]*\)$/\1/')"
if [ "$(readlink -f "$HOME/.local/share/ansible/tasks/$TASK_FILE_NAME")" != "$TASK_FILE" ]; then
ln -s "$TASK_FILE" "$HOME/.local/share/ansible/tasks/$TASK_FILE_NAME"
fi
done
fi