summaryrefslogtreecommitdiffstats
path: root/prompt.sh
blob: 5fd8b27df8a7e240c310d2e5a834ff7804cab3c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
source ./git-base.sh

local_ahead="$(commits_ahead_of_remote)"
ahead_arrow="↑"

if [[ ("$local_ahead" -gt 0) ]]; then
  local_ahead=" ${local_ahead}${ahead_arrow}"
else
  local_ahead=""
fi

local_behind="$(commits_behind_of_remote)"
behind_arrow="↓"

if [[ "$local_behind" -gt "0" ]]; then
  local_behind=" ${local_behind}${behind_arrow}"
else
  local_behind=""
fi

prompt="$(branch_name) $(zsh_color_local_commits) $(bash_color_changes_status)"

echo $prompt