- git config --global user.name 'Test'
- git config --global user.email 'test@example.org'
- ./keyringer test init ~/temp/tests/keyringer
- - gpg --with-colons --list-keys | grep "^uid" | awk -F ':' '{ x = $10; gsub(/.*</, "", x); gsub(/>/, "", x); print x, $8; }' >> ~/temp/tests/keyringer/config/recipients/default
+
+ # Build the recipients configuration
+ # Explanation on the "paste" syntax is available at https://stackoverflow.com/a/9605450
+ - gpg --with-colons --list-keys | grep "^uid" | head -1 | awk -F ':' '{ x = $10; gsub(/.*</, "", x); gsub(/>/, "", x); print x; }' > ~/temp/tests/recipients
+ - gpg --with-colons --list-public-keys --with-fingerprint | grep "^fpr" | head -1 | awk -F ':' '{ print $10 }' >> ~/temp/tests/recipients
+ - paste -d " " - - < ~/temp/tests/recipients > ~/temp/tests/keyringer/config/recipients/default
+ - rm ~/temp/tests/recipients
- ./keyringer test recipients ls
# Test the keyring in the develop branch