abuild-keygen: Fix crash on unknown git user.email

This commit is contained in:
Tom Lebreux 2021-04-30 19:19:06 -04:00
parent 3da770ce35
commit e520288df5

View File

@ -27,7 +27,7 @@ get_privkey_file() {
# if PACKAGER does not contain a valid email address, then ask git
if [ -z "$emailaddr" ] || [ "${emailaddr##*@}" = "$emailaddr" ]; then
emailaddr=$(git config --get user.email 2>/dev/null)
emailaddr=$(git config --get user.email 2>/dev/null || true)
fi
default_name="${emailaddr:-$USER}-$(printf "%x" $(date +%s))"