summaryrefslogtreecommitdiffstats
path: root/defaultenv-2
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-09-11 12:19:26 +0200
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-09-14 00:45:38 +0800
commite23b943a42aedb31e9959dba8696699ee1a4b1d7 (patch)
tree4cb49e4a7e53e1e782e9422e781c035053eb580f /defaultenv-2
parent39cc6c9cbd3e9233f75d8b614ac498290a138d3a (diff)
downloadbarebox-e23b943a42aedb31e9959dba8696699ee1a4b1d7.tar.gz
barebox-e23b943a42aedb31e9959dba8696699ee1a4b1d7.tar.xz
defaultenv-2/ansi-colors: export color only if enable
This will allow to do not check it everywhere Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv-2')
-rw-r--r--defaultenv-2/base/data/ansi-colors4
-rw-r--r--defaultenv-2/menu/menu/mainmenu4
2 files changed, 5 insertions, 3 deletions
diff --git a/defaultenv-2/base/data/ansi-colors b/defaultenv-2/base/data/ansi-colors
index c71b6b7998..636532979a 100644
--- a/defaultenv-2/base/data/ansi-colors
+++ b/defaultenv-2/base/data/ansi-colors
@@ -1,5 +1,9 @@
#!/bin/sh
+if [ ${global.allow_color} != "true" ]; then
+ exit
+fi
+
# Colors
export RED='\e[1;31m'
export BLUE='\e[1;34m'
diff --git a/defaultenv-2/menu/menu/mainmenu b/defaultenv-2/menu/menu/mainmenu
index d7b0033220..5bd7027e2a 100644
--- a/defaultenv-2/menu/menu/mainmenu
+++ b/defaultenv-2/menu/menu/mainmenu
@@ -3,9 +3,7 @@
savepath=$PATH
export menupath=$PATH:/env/menu
-if [ ${global.allow_color} = "true" ]; then
- . /env/data/ansi-colors
-fi
+. /env/data/ansi-colors
while true; do
export PATH=${menupath}