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:
parent
09dd9d4a12
commit
5af548c6a8
1 changed files with 10 additions and 7 deletions
17
bash/bashrc
17
bash/bashrc
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue