diff options
Diffstat (limited to 'lib-src/mr/config')
-rw-r--r-- | lib-src/mr/config | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib-src/mr/config b/lib-src/mr/config index f49febb6..dd9efe12 100644 --- a/lib-src/mr/config +++ b/lib-src/mr/config @@ -41,16 +41,21 @@ git_update = git pull-safe # --- tests, plus my code for detecting Git-on-Windows lib = + if [ -n "$USER" ]; then + whoami="$USER" + elif [ -n "$LOGNAME" ]; then + whoami="$LOGNAME" + else + # Cut off any Windows machine name. + whoami="$(whoami)"; whoami="${whoami##*\\}" + fi + # Ensure it's a short hostname, not an FQDN. + hostname="$(hostname)"; hostname="${hostname%%.*}" + # win32() { test "$(perl -e 'print $^O')" = "msys" } # - hostname="$(hostname | sed -e 's#\..*$##')" - # - whoami="$(whoami)" - # cut off the machine name on Windows - win32 && whoami=${whoami##*\\} - # on() { for host in $@; do if [ "${host%@*}" != "${host#*@}" ]; then |