fix age-import function

This commit is contained in:
Philip Henning 2023-10-15 13:17:54 +02:00
parent c9fc52dc5c
commit d4bde11d13

View file

@ -51,6 +51,7 @@ if [[ $(command -v age) ]]; then
}
age-import-secret() {
local data=$(</dev/stdin);
set -euf -o pipefail
local secret_path="${1}"
@ -60,7 +61,7 @@ if [[ $(command -v age) ]]; then
mkdir -p "${dirname}"
age ${recipients_list[@]} --encrypt --armor --output "${secret_path}"
echo -n ${data} | age $(echo -n "${recipients_list[@]}" | sed -e "s/^\'//" -e "s/\'$//") --encrypt --armor --output "${secret_path}"
set +efu +o pipefail
}