agnoster: add guard to bzr prompt

Depending on the exit code of 'bzr status' is not enough,
as some command_not_found_handler could be used which
would then override that code.
Use the associative list of commands from zsh/param instead.

Signed-off-by: Olivier Tilmans <olivier.tilmans@uclouvain.be>
This commit is contained in:
Olivier Tilmans 2016-09-20 10:35:09 +02:00
commit 1bd0a90e9e
No known key found for this signature in database
GPG key ID: C637BB356DF359A4

View file

@ -128,6 +128,7 @@ prompt_git() {
}
prompt_bzr() {
(( $+commands[bzr] )) || return
if (bzr status >/dev/null 2>&1); then
status_mod=`bzr status | head -n1 | grep "modified" | wc -m`
status_all=`bzr status | head -n1 | wc -m`