Skip to content

Commit e825a07

Browse files
committed
fix pygmetize error handling
1 parent aecfcf1 commit e825a07

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bin/bashrc.redis-scan.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,9 @@ RedisScan() { # scan command with sleep between iterations
517517
value="$json"
518518
if [ "$colorJson" = 1 ]
519519
then
520-
if echo '{}' | pygmentize -l json 2>&1 >/dev/null
520+
if echo '{}' | pygmentize -l json 2>/dev/null >/dev/null
521521
then
522-
value=`echo "$json" | pygmentize -l json 2>/dev/null || echo ''`
523-
[ -n "$value" ] || value="$json"
522+
value=`echo "$json" | pygmentize -l json 2>/dev/null || echo "$json"`
524523
fi
525524
fi
526525
fi

0 commit comments

Comments
 (0)