{{- if eq .chezmoi.os "windows" -}}
if (-not(Test-Path -Path $env:USERPROFILE\.key.asc -PathType Leaf)) {
    gpg --decrypt -o "$env:USERPROFILE\.key.asc" "{{ .chezmoi.sourceDir }}/key.txt.asc"
    gpg --import --armor "$env:USERPROFILE\.key.asc"
}
{{- else -}}
#!/bin/sh

if [ ! -f "${HOME}/.key.asc" ]; then
    gpg --decrypt -o "${HOME}/.key.asc" "{{ .chezmoi.sourceDir }}/key.txt.asc"
    chmod 600 "${HOME}/.key.asc"
    gpg --import --armor "${HOME}/.key.asc"
fi
{{- end -}}
