From 813cbeb31c861a0c061f035519c0403379c2c0d1 Mon Sep 17 00:00:00 2001 From: Bruno Miguel Silva Date: Thu, 9 Jan 2014 16:15:13 +0000 Subject: [PATCH] changed how hostname is determined --- bash/bash_profile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bash/bash_profile b/bash/bash_profile index 04bce45..fc6b398 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -1,8 +1,3 @@ -#function parse_git_branch { -# git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' -#} - -#export PS1='\u@\h:\W $(parse_git_branch)\n\$ ' export EDITOR='vi' export WORKON_HOME=$HOME/.virtualenvs export LC_CTYPE="en_US.UTF-8" @@ -18,8 +13,16 @@ alias gitpretty="git log --pretty=format:'%h : %Cblue%aN%Creset : %Cred%d%Creset alias ls='ls -G' alias ll='ls -lG' -if [[ -r $HOME/.`hostname -s`_bash_profile ]]; then - source $HOME/.`hostname -s`_bash_profile +if [[ -r $HOME/.host_nickname ]]; then + HOST_NICKNAME=`cat .host_nickname` +else + HOST_NICKNAME=`hostname -s` +fi + +export PS1="\u@${HOST_NICKNAME}:\W \$ " + +if [[ -r $HOME/.${HOST_NICKNAME}_bash_profile ]]; then + source $HOME/.${HOST_NICKNAME}_bash_profile else echo "WARNING: Can't find custom bash_profile" fi