Skip to content

Commit 38a6561

Browse files
authored
fix: add colorize helper (#470)
1 parent c85c1c9 commit 38a6561

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bin/pyenv-virtualenv

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ parse_options() {
5454
done
5555
}
5656

57+
colorize() {
58+
if [ -t 1 ]; then printf "\e[%sm%s\e[m" "$1" "$2"
59+
else echo -n "$2"
60+
fi
61+
}
62+
5763
resolve_link() {
5864
$(type -p greadlink readlink | head -1) "$1"
5965
}

0 commit comments

Comments
 (0)