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

mkageconfig

# disable age command
appendline $CHEZMOICONFIGDIR/chezmoi.toml '    command = "false"'
[!windows] chmod 755 golden/age
cp golden/age bin

prependline $CHEZMOICONFIGDIR/chezmoi.toml 'useBuiltinAge = true'

# test that chezmoi add --encrypt encrypts
cp golden/.encrypted $HOME
chezmoi add --encrypt $HOME${/}.encrypted
exists $CHEZMOISOURCEDIR/encrypted_dot_encrypted.age
grep '-----BEGIN AGE ENCRYPTED FILE-----' $CHEZMOISOURCEDIR/encrypted_dot_encrypted.age

# test that chezmoi cat decrypts
chezmoi cat $HOME${/}.encrypted
cmp stdout golden/.encrypted

-- golden/.encrypted --
# contents of .encrypted
-- golden/age --
#!/bin/sh

exit 1
