diff options
author | Leonid Volnitsky <leonid@volnitsky.com> | 2012-07-06 10:12:16 -0700 |
---|---|---|
committer | Leonid Volnitsky <leonid@volnitsky.com> | 2012-07-06 10:12:16 -0700 |
commit | bd2ab744eb90011e8efdd0899e25752ed9567b8a (patch) | |
tree | 554128a46b3a920779f6409d98feb87f17604909 | |
parent | Merge branch 'master' of https://github.com/amiryal/git-prompt into amiryal-m... (diff) | |
parent | hostname in cygwin (diff) | |
download | git-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-x | git-prompt.sh | 6 |
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` |