From d0cda1b26d6cf25d97250f989812aba5d165a8f3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 13 Oct 2014 17:00:07 +1300 Subject: Use arith context for boolean vars --- bash/bashrc.d/prompt.bash | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bash') 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 -- cgit v1.2.3