Skip to content

Commit c1ae800

Browse files
authored
Merge pull request #2 from ukleinek/master
random improvents
2 parents d6bf040 + afaebe9 commit c1ae800

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

bin/sys

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function startsWithDash {
55
test "${1:0:1}" = "-"
66
}
77
function paramsAreEmpty {
8-
test ${#@} -eq 0
8+
test $# -eq 0
99
}
1010

1111
function printHelp {
@@ -51,16 +51,16 @@ fi
5151
### create/find credentials for using with git
5252

5353
if [ -n "$SUDO_USER" ]; then
54-
homedir=$(getent passwd ${SUDO_USER} | cut -d\: -f 6)
54+
homedir=$(getent passwd ${SUDO_USER} | cut -d: -f 6)
5555
git_config_file="${homedir}"/.gitconfig
5656
hostname=$(hostname -f)
5757
# check for user credentials!
5858
if [ -z "$GIT_COMMITTER_NAME" ]; then
5959
# if they do not exist, try to read from gitconfig in home dir
60-
export GIT_COMMITTER_NAME=$(git config -f $git_config_file user.name)
61-
export GIT_AUTHOR_NAME=$(git config -f $git_config_file user.name)
62-
export GIT_COMMITTER_EMAIL=$(git config -f $git_config_file user.email)
63-
export GIT_AUTHOR_EMAIL=$(git config -f $git_config_file user.email)
60+
export GIT_COMMITTER_NAME=$(git config -f "$git_config_file" user.name)
61+
export GIT_AUTHOR_NAME=$(git config -f "$git_config_file" user.name)
62+
export GIT_COMMITTER_EMAIL=$(git config -f "$git_config_file" user.email)
63+
export GIT_AUTHOR_EMAIL=$(git config -f "$git_config_file" user.email)
6464
# if this fails ... generate the credentials
6565
fi
6666
: ${GIT_COMMITTER_EMAIL:=${SUDO_USER}@${hostname}}
@@ -69,7 +69,7 @@ if [ -n "$SUDO_USER" ]; then
6969
: ${GIT_AUTHOR_NAME:=${SUDO_USER}}
7070
fi
7171
################################################################################
72-
export GIT_DIR=$SYSGIT_PATH_OFFSET/var/lib/sysgit
72+
export GIT_DIR="$SYSGIT_PATH_OFFSET/var/lib/sysgit"
7373
test -e /var/lib/sysgit/ssh && export GIT_SSH=/var/lib/sysgit/ssh
7474

7575
"$@"

0 commit comments

Comments
 (0)