Skip to content

Commit

Permalink
Merge pull request #2 from ukleinek/master
Browse files Browse the repository at this point in the history
random improvents
  • Loading branch information
Farom authored Oct 20, 2020
2 parents d6bf040 + afaebe9 commit c1ae800
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bin/sys
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function startsWithDash {
test "${1:0:1}" = "-"
}
function paramsAreEmpty {
test ${#@} -eq 0
test $# -eq 0
}

function printHelp {
Expand Down Expand Up @@ -51,16 +51,16 @@ fi
### create/find credentials for using with git

if [ -n "$SUDO_USER" ]; then
homedir=$(getent passwd ${SUDO_USER} | cut -d\: -f 6)
homedir=$(getent passwd ${SUDO_USER} | cut -d: -f 6)
git_config_file="${homedir}"/.gitconfig
hostname=$(hostname -f)
# check for user credentials!
if [ -z "$GIT_COMMITTER_NAME" ]; then
# if they do not exist, try to read from gitconfig in home dir
export GIT_COMMITTER_NAME=$(git config -f $git_config_file user.name)
export GIT_AUTHOR_NAME=$(git config -f $git_config_file user.name)
export GIT_COMMITTER_EMAIL=$(git config -f $git_config_file user.email)
export GIT_AUTHOR_EMAIL=$(git config -f $git_config_file user.email)
export GIT_COMMITTER_NAME=$(git config -f "$git_config_file" user.name)
export GIT_AUTHOR_NAME=$(git config -f "$git_config_file" user.name)
export GIT_COMMITTER_EMAIL=$(git config -f "$git_config_file" user.email)
export GIT_AUTHOR_EMAIL=$(git config -f "$git_config_file" user.email)
# if this fails ... generate the credentials
fi
: ${GIT_COMMITTER_EMAIL:=${SUDO_USER}@${hostname}}
Expand All @@ -69,7 +69,7 @@ if [ -n "$SUDO_USER" ]; then
: ${GIT_AUTHOR_NAME:=${SUDO_USER}}
fi
################################################################################
export GIT_DIR=$SYSGIT_PATH_OFFSET/var/lib/sysgit
export GIT_DIR="$SYSGIT_PATH_OFFSET/var/lib/sysgit"
test -e /var/lib/sysgit/ssh && export GIT_SSH=/var/lib/sysgit/ssh

"$@"

0 comments on commit c1ae800

Please sign in to comment.