diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-10-13 17:00:07 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-10-13 17:00:07 +1300 |
commit | d0cda1b26d6cf25d97250f989812aba5d165a8f3 (patch) | |
tree | e5acb3457b3dbee0382ddedf20bda5cddf8264e1 /bash | |
parent | Add new targets (diff) | |
download | dotfiles-d0cda1b26d6cf25d97250f989812aba5d165a8f3.tar.gz dotfiles-d0cda1b26d6cf25d97250f989812aba5d165a8f3.zip |
Use arith context for boolean vars
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index e9ed5d31..b505fa97 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -95,13 +95,13 @@ prompt() { # Build state array from status output flags local -a state - if [[ $ready ]] ; then + if ((ready)) ; then state=("${state[@]}" '+') fi - if [[ $modified ]] ; then + if ((modified)) ; then state=("${state[@]}" '!') fi - if [[ $untracked ]] ; then + if ((untracked)) ; then state=("${state[@]}" '?') fi @@ -144,10 +144,10 @@ prompt() { # Build state array from status output flags local -a state - if [[ $modified ]] ; then + if ((modified)) ; then state=("${state[@]}" '!') fi - if [[ $untracked ]] ; then + if ((untracked)) ; then state=("${state[@]}" '?') fi @@ -203,10 +203,10 @@ prompt() { # Add appropriate state flags local -a state - if [[ $modified ]] ; then + if ((modified)) ; then state=("${state[@]}" '!') fi - if [[ $untracked ]] ; then + if ((untracked)) ; then state=("${state[@]}" '?') fi |