about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-07-06 20:51:33 -0500
committerCase Duckworth2022-07-06 20:51:33 -0500
commitc20a2b097fc20b1499f6aa5b14767c6ef49ee6d3 (patch)
tree526d14202c1f67d52a0c7f962ae9436efb184fb4
parentGenerate copyright from provided author, email, year (diff)
downloadlicensor-c20a2b097fc20b1499f6aa5b14767c6ef49ee6d3.tar.gz
licensor-c20a2b097fc20b1499f6aa5b14767c6ef49ee6d3.zip
Use if forms
-rwxr-xr-xlicensor7
1 files changed, 4 insertions, 3 deletions
diff --git a/licensor b/licensor index 9f9a808..3458e7d 100755 --- a/licensor +++ b/licensor
@@ -145,12 +145,13 @@ search_licenses() {
145 145
146guess_author() { 146guess_author() {
147 author="$(git config --get user.name)" 147 author="$(git config --get user.name)"
148 [ -z "$author" ] && 148 if [ -z "$author" ]; then
149 author="$(getent passwd "$USER" | awk -F: '{sub(/,+/,"",$5);print $5}')" 149 author="$(getent passwd "$USER" | awk -F: '{sub(/,+/,"",$5);print $5}')"
150 [ -z "$author" ] && 150 fi
151 author="$USER" 151 if [ -z "$author" ]; then author="$USER"; fi
152 put "$author" 152 put "$author"
153} 153}
154
154guess_email() { 155guess_email() {
155 email="$(git config --get user.email)" 156 email="$(git config --get user.email)"
156 put "$email" 157 put "$email"