summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <leonid@volnitsky.com>2012-07-06 10:12:16 -0700
committerLeonid Volnitsky <leonid@volnitsky.com>2012-07-06 10:12:16 -0700
commitbd2ab744eb90011e8efdd0899e25752ed9567b8a (patch)
tree554128a46b3a920779f6409d98feb87f17604909
parentMerge branch 'master' of https://github.com/amiryal/git-prompt into amiryal-m... (diff)
parenthostname in cygwin (diff)
downloadgit-prompt-bd2ab744eb90011e8efdd0899e25752ed9567b8a.tar.gz
git-prompt-bd2ab744eb90011e8efdd0899e25752ed9567b8a.tar.bz2
git-prompt-bd2ab744eb90011e8efdd0899e25752ed9567b8a.zip
Merge pull request #17 from juanpabloaj/cygwin
hostname in cygwin
-rwxr-xr-xgit-prompt.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index 8bdbb3f..fb24030 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -297,7 +297,11 @@ set_shell_label() {
host=${HOSTNAME}
if [[ $short_hostname = "on" ]]; then
- host=`hostname -s`
+ if [[ "$(uname)" =~ "CYGWIN" ]]; then
+ host=`hostname`
+ else
+ host=`hostname -s`
+ fi
fi
host=${host#$default_host}
uphost=`echo ${host} | tr a-z A-Z`