Skip to content

Commit

Permalink
address shell expansion bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Dec 17, 2014
1 parent 39ae130 commit 10dbda6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .bash_prompt
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,15 @@ set_prompts() {
git rev-parse --is-inside-work-tree &>/dev/null || return

# quickest check for what branch we're on
branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
branch=`git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||'`

# check if it's dirty (via github.com/sindresorhus/pure)
dirty=$(git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ]&& echo -e "*")

gitstatus=""
gitstatus+="${white} on "
gitstatus+="${purple}$branch"
gitstatus+="${cyan}$dirty"

echo $gitstatus;
[ -n "$s" ] && s=" [$s]"
printf "%s" "$1$branch$2$dirty"

return
}


Expand All @@ -108,7 +106,7 @@ set_prompts() {
PS1+="\[$bold\]"
PS1+="\[$(usernamehost)\]" # username at host
PS1+="\[$green\]\w" # working directory
PS1+="\[$(prompt_git)\]" # git repository details
PS1+="\$(prompt_git \"$white on $purple\" \"$cyan\")" # git repository details
PS1+="\n"
PS1+="\[$reset$white\]\\$ \[$reset\]"

Expand Down

0 comments on commit 10dbda6

Please sign in to comment.