install.fairie/dotfiles/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_60-cleanup.tmpl

25 lines
809 B
Bash

#!/usr/bin/env bash
{{ if or (eq .chezmoi.os "linux") (eq .chezmoi.os "darwin") }}
source "$HOME/.config/shell/exports"
logg 'Ensuring Taskfiles are linked properly'
if [ -d "$HOME/.local/shared-common" ]; then
cp ~/.local/shared-common/Taskfile.yml ~/.local/Taskfile.yml
sed -i 's/\.\/\.config\/taskfiles/taskfiles/g' ~/.local/Taskfile.yml
ln -s ~/.local/taskfiles ~/.local/shared-common/common/.config/taskfiles
fi
{{ if (eq .chezmoi.os "darwin") }}
if command -v gsed > /dev/null; then
gsed -i 's/\.\/\.config\/taskfiles/taskfiles/g' ~/.local/Taskfile.yml
else
logg warn 'Unable to fix `~/.local/Taskfile.yml` because gsed GNU compatibility tool is not installed.'
fi
{{- end }}
{{ else if chezmoi.os "windows" }}
Remove-Item -LiteralPath "$env:HOMEPATH\Library" -Force -Recurse
{{- end }}