[!exec:age] skip 'age not found in $PATH'

mkageconfig

# test encrypt template function
chezmoi execute-template '{{ "plaintext" | encrypt }}'
stdout '-----BEGIN AGE ENCRYPTED FILE-----'

# test encrypt and decrypt template function round trip
chezmoi execute-template '{{ "plaintext\n" | encrypt | decrypt }}'
cmp stdout golden/plaintext

[windows] stop 'remaining tests rely on UNIX path handling' # FIXME

# test decrypt template function
chezmoi encrypt --output=$HOME${/}ciphertext.age golden/plaintext
chezmoi execute-template '{{ joinPath (env "HOME") "ciphertext.age" | include | decrypt }}'
cmp stdout golden/plaintext

-- golden/plaintext --
plaintext
