diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2022-06-14 05:10:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2022-06-14 11:59:26 +0000 |
commit | a71a5c0bd914cc41dc21571fd9f80a6502164512 (patch) | |
tree | ec7f3f0a4d4b1cc1dd5b41e5faff57611162dae0 /git | |
parent | Adding quotes arround some variables in git-tools to prevent globbing and wor... (diff) | |
download | service-tools-a71a5c0bd914cc41dc21571fd9f80a6502164512.tar.xz service-tools-a71a5c0bd914cc41dc21571fd9f80a6502164512.zip |
Changing default value handling for variables in git-whoami to more portable format.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'git')
-rwxr-xr-x | git/bin/git-whoami | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/bin/git-whoami b/git/bin/git-whoami index bf1645d..954a5ba 100755 --- a/git/bin/git-whoami +++ b/git/bin/git-whoami @@ -17,10 +17,10 @@ get_name() { git config user.name || getent passwd "$(id -un)" | cut -d : -f 5 | cut -d , -f 1 } -: ${GIT_AUTHOR_NAME=$(get_name)} -: ${GIT_COMMITTER_NAME=$(get_name)} -: ${GIT_AUTHOR_EMAIL=$(get_email)} -: ${GIT_COMMITTER_EMAIL=$(get_email)} +GIT_AUTHOR_NAME="${GIT_AUTHOR_NAME:-$(get_name)}" +GIT_AUTHOR_EMAIL="${GIT_AUTHOR_EMAIL:-$(get_email)}" +GIT_COMMITTER_NAME="${GIT_COMMITER_NAME:-$(get_name)}" +GIT_COMMITTER_EMAIL="${GIT_COMMITER_EMAIL:-$(get_email)}" author="$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" commit="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" |