remove newlines in recipient keys file

if not removed, empty lines will be added to the final encryption
command as --recipient '' which causes the command to fail with invalid
recipient ''
This commit is contained in:
Tim Häring 2022-05-15 20:03:52 +02:00
parent 0d5e59ed64
commit 0e2fb13ecf

View file

@ -114,7 +114,7 @@ trap "cleanup" 0 2 3 15
function edit { function edit {
FILE=$1 FILE=$1
KEYS=$((${nixInstantiate} --eval -E "(let rules = import $RULES; in builtins.concatStringsSep \"\n\" rules.\"$FILE\".publicKeys)" | ${sedBin} 's/"//g' | ${sedBin} 's/\\n/\n/g') || exit 1) KEYS=$((${nixInstantiate} --eval -E "(let rules = import $RULES; in builtins.concatStringsSep \"\n\" rules.\"$FILE\".publicKeys)" | ${sedBin} 's/"//g' | ${sedBin} 's/\\n/\n/g') | ${sedBin} '/^$/d' || exit 1)
if [ -z "$KEYS" ] if [ -z "$KEYS" ]
then then