diff options
author | Case Duckworth | 2022-07-06 20:51:33 -0500 |
---|---|---|
committer | Case Duckworth | 2022-07-06 20:51:33 -0500 |
commit | c20a2b097fc20b1499f6aa5b14767c6ef49ee6d3 (patch) | |
tree | 526d14202c1f67d52a0c7f962ae9436efb184fb4 | |
parent | Generate copyright from provided author, email, year (diff) | |
download | licensor-c20a2b097fc20b1499f6aa5b14767c6ef49ee6d3.tar.gz licensor-c20a2b097fc20b1499f6aa5b14767c6ef49ee6d3.zip |
Use if forms
-rwxr-xr-x | licensor | 7 |
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 | ||
146 | guess_author() { | 146 | guess_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 | |||
154 | guess_email() { | 155 | guess_email() { |
155 | email="$(git config --get user.email)" | 156 | email="$(git config --get user.email)" |
156 | put "$email" | 157 | put "$email" |