fix parse_git_dirty() to work on Solaris

We need this as Solaris's tail doesn't support `-n` option. However it does support old `-[n]` format so we can simply use `tail -1` instead of `tail -n1`
This commit is contained in:
Sergey Mashkov 2017-11-03 09:01:56 +03:00 committed by GitHub
commit 823bee659c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ function parse_git_dirty() {
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -1)
fi
if [[ -n $STATUS ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"