1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 09:15:24 +02:00

[bash] Hide the stderr of __svn_ps1 (if subversion is not installed)

This commit is contained in:
Hyacinthe Cartiaux 2016-03-10 19:15:56 +01:00
parent 09dd9d4a12
commit 5af548c6a8

View file

@ -114,13 +114,16 @@ HISTTIMEFORMAT="[%d/%m/%Y %H:%M:%S] "
## display the current subversion revision (to be used later in the prompt)
__svn_ps1() {
local svnversion
svnversion=$(svnversion | sed -e "s/[:M]//g")
# Continue if $svnversion is numerical
if let $svnversion 2>/dev/null
then
printf " (svn:%s)" "$(svnversion)"
fi
(
local svnversion
svnversion=$(svnversion | sed -e "s/[:M]//g")
# Continue if $svnversion is numerical
let $svnversion
if [[ "$?" -eq "0" ]]
then
printf " (svn:%s)" "$(svnversion)"
fi
) 2>/dev/null
}
# render __git_ps1 even better so as to show activity in a git repository