Skip to content

Commit

Permalink
Merge branch "wwwutz/master"
Browse files Browse the repository at this point in the history
* wwwutz/master:
  bee: Minor color fixes
  non colorized output per default. colors via BEE_COLOR='yes'
  • Loading branch information
donald committed Apr 22, 2016
2 parents b1e7cb9 + b2e97de commit 5e5a7de
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
12 changes: 8 additions & 4 deletions src/bee-list.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ function usage() {
}

function config_init_colors() {
if [ -t 1 ] ; then
: ${BEE_COLOR:="yes"}
if [ ! -t 1 ] ; then
BEE_COLOR="no"
fi
if [ "${BEE_COLOR}" != "no" ] ; then
COLOR_NORMAL="\\033[0;39m\\033[0;22m"
COLOR_GREEN="\\033[0;32m"
COLOR_YELLOW="\\033[0;33m"
Expand All @@ -105,9 +109,9 @@ function config_init_colors() {
COLOR_PURPLE=""
COLOR_BRACKET=""
COLOR_BRCONTENT=""
COLOR_INFO="**INFO** "
COLOR_ERROR="**ERROR** "
COLOR_WARN="**WARNING** "
COLOR_INFO=""
COLOR_ERROR=""
COLOR_WARN=""
COLOR_INSTALLABLE="installable "
COLOR_UPDATABLE=" updatable "
fi
Expand Down
13 changes: 9 additions & 4 deletions src/beelib.config.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
: ${BEE_BINDIR:=@BINDIR@}

function config_init_colors() {
if [ -t 1 ] ; then
: ${BEE_COLOR:="yes"}
if [ ! -t 1 ] ; then
BEE_COLOR="no"
fi
if [ "${BEE_COLOR}" != "no" ] ; then
COLOR_NORMAL="\\033[0;39m\\033[0;22m"
COLOR_GREEN="\\033[0;32m"
COLOR_YELLOW="\\033[0;33m"
Expand All @@ -49,9 +53,9 @@ function config_init_colors() {
COLOR_PURPLE=""
COLOR_BRACKET=""
COLOR_BRCONTENT=""
COLOR_INFO="**INFO** "
COLOR_ERROR="**ERROR** "
COLOR_WARN="**WARNING** "
COLOR_INFO=""
COLOR_ERROR=""
COLOR_WARN=""
fi
}

Expand Down Expand Up @@ -359,6 +363,7 @@ function config_init() {
config_load_local_config
config_load_user_config
config_load_system_config
config_init_colors
config_verify_builtin_config
config_verify_builtin_prefixes
config_handle_deprecated_config
Expand Down
4 changes: 1 addition & 3 deletions src/beesh.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -916,16 +916,14 @@ while true ; do
esac
done

config_init_colors
config_init

echo -e "${COLOR_CYAN}BEE v${BEE_VERSION} 2009-2016"
echo -e " by Marius Tolzmann <marius@mariux.de>"
echo -e " Matthias Ruester <ruester@molgen.mpg.de>"
echo -e " Tobias Dreyer <dreyer@molgen.mpg.de>"
echo -e "${COLOR_NORMAL}"

config_init

config_set_skiplist

print_info " BEE_SKIPLIST ${BEE_SKIPLIST}"
Expand Down

0 comments on commit 5e5a7de

Please sign in to comment.