mirror of
				https://github.com/ohmybash/oh-my-bash.git
				synced 2024-05-11 05:55:37 +00:00 
			
		
		
		
	themes: Fix wrong usage of command substitutions in conditions
This commit is contained in:
		@@ -249,7 +249,7 @@ git_status_dirty() {
 | 
			
		||||
# Git: branch/detached head, dirty status
 | 
			
		||||
prompt_git() {
 | 
			
		||||
    local ref dirty
 | 
			
		||||
    if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
 | 
			
		||||
    if git rev-parse --is-inside-work-tree &>/dev/null; then
 | 
			
		||||
        ZSH_THEME_GIT_PROMPT_DIRTY='±'
 | 
			
		||||
        dirty=$(git_status_dirty)
 | 
			
		||||
        ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)"
 | 
			
		||||
 
 | 
			
		||||
@@ -137,12 +137,12 @@ prompt_git() {
 | 
			
		||||
			git update-index --really-refresh -q &>/dev/null;
 | 
			
		||||
 | 
			
		||||
			# Check for uncommitted changes in the index.
 | 
			
		||||
			if ! $(git diff --quiet --ignore-submodules --cached); then
 | 
			
		||||
			if ! git diff --quiet --ignore-submodules --cached; then
 | 
			
		||||
				s+='+';
 | 
			
		||||
			fi;
 | 
			
		||||
 | 
			
		||||
			# Check for unstaged changes.
 | 
			
		||||
			if ! $(git diff-files --quiet --ignore-submodules --); then
 | 
			
		||||
			if ! git diff-files --quiet --ignore-submodules --; then
 | 
			
		||||
				s+='!';
 | 
			
		||||
			fi;
 | 
			
		||||
 | 
			
		||||
@@ -152,7 +152,7 @@ prompt_git() {
 | 
			
		||||
			fi;
 | 
			
		||||
 | 
			
		||||
			# Check for stashed files.
 | 
			
		||||
			if $(git rev-parse --verify refs/stash &>/dev/null); then
 | 
			
		||||
			if git rev-parse --verify refs/stash &>/dev/null; then
 | 
			
		||||
				s+='$';
 | 
			
		||||
			fi;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@ function is_integer() { # helper function for todo-txt-count
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
todo_txt_count() {
 | 
			
		||||
    if `hash todo.sh 2>&-`; then # is todo.sh installed
 | 
			
		||||
    if _omb_util_command_exists todo.sh; then # is todo.sh installed
 | 
			
		||||
        count=$(todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }')
 | 
			
		||||
        if is_integer $count; then # did we get a sane answer back
 | 
			
		||||
            echo "${BRACKET_COLOR}[${STRING_COLOR}T:$count${BRACKET_COLOR}]$normal"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user