#!/usr/bin/env bash {{ if or (eq .chezmoi.os "linux") (eq .chezmoi.os "darwin") }} source "$HOME/.config/shell/exports" echo 'Cleaning up unnecessary artifacts' rm -rf ~/AppData {{ if or (eq .chezmoi.os "linux") }} rm -rf ~/Library {{ end }} 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 '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 }}