Commit 28bb3095 authored by PENGUEN Julien's avatar PENGUEN Julien
Browse files

simplification gestion couleur

parent 951c45ef
......@@ -33,3 +33,11 @@ RESOLUTION_BY_COL=500
##########
VOLUME_MOUNT="NONE"
##########
# COLORS #
##########
RED='\033[0;31m' #Red
GREEN='\033[0;32m' # Green
COLOR_OFF='\033[0m' # Text Reset
......@@ -20,20 +20,20 @@ function_message()
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[31m========================================================="
echo -e "${RED}========================================================="
echo -e "WARNING => ${message}"
echo -e "=========================================================\033[0m"
echo -e "=========================================================${COLOR_OFF}"
elif [ "$type_message" == "TYPE_FILE_ERROR" ]; then
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[31m========================================================="
echo -e "${RED}========================================================="
echo -e " ERROR with option '${option}' "
echo -e ""
echo -e "${message}"
echo -e "=========================================================\033[0m"
echo -e "=========================================================${COLOR_OFF}"
echo ""
echo "------------------------------------"
......@@ -42,11 +42,11 @@ function_message()
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[31m========================================================="
echo -e "${RED}========================================================="
echo -e " ERROR with option '${option}' "
echo -e ""
echo -e "${message}"
echo -e "=========================================================\033[0m"
echo -e "=========================================================${COLOR_OFF}"
echo ""
echo "------------------------------------"
......@@ -55,22 +55,22 @@ function_message()
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[32m========"
echo -e "${GREEN}========"
echo -e "= HELP ="
echo -e "========\033[0m"
echo -e "========${COLOR_OFF}"
elif [ "$type_message" == "TYPE_UNKNOWN" ]; then
echo ""
echo -e "\033[31m==============================="
echo -e "${RED}==============================="
echo -e " error: unrecognized arguments "
echo -e "===============================\033[0m"
echo -e "===============================${COLOR_OFF}"
elif [ "$type_message" == "TYPE_EXIST_VERSION" ]; then
echo ''
echo -e "\033[31m===================================="
echo -e "${RED}===================================="
echo -e " WARNING"
echo -e "====================================\033[0m"
echo -e "====================================${COLOR_OFF}"
echo ''
echo '------------------------------------'
echo ''
......@@ -89,9 +89,9 @@ function_message()
elif [ "$type_message" == "TYPE_FORCE_WARNING" ]; then
echo ''
echo -e "\033[31m===================================="
echo -e "${RED}===================================="
echo -e " WARNING"
echo -e "====================================\033[0m"
echo -e "====================================${COLOR_OFF}"
echo ''
echo '------------------------------------'
echo ''
......@@ -107,9 +107,9 @@ function_message()
elif [ "$type_message" == "TYPE_DELETE_EXIST_VERSION" ]; then
echo ''
echo -e "\033[31m===================================="
echo -e "${RED}===================================="
echo -e " WARNING"
echo -e "====================================\033[0m"
echo -e "====================================${COLOR_OFF}"
echo ''
echo '------------------------------------'
echo ''
......@@ -1177,7 +1177,7 @@ case ${sort_arg_keys[0]} in
if [ -f ${area_ajs[$k]} ]; then
echo "=> ${area_ajs[$k]} exist"
else
echo -e "=> \033[31mWARNING\033[0m : ${area_ajs[$k]} not found"
echo -e "=> ${RED}WARNING${COLOR_OFF} : ${area_ajs[$k]} not found"
echo "=> construction of ${area_ajs[$k]} in progress ..."
function_create_ajs_file ${INPUT_FILE_SURVEYS} ${area_ajs[$k]} ${list_zone[$k]} ${list_ra[k]} ${list_dec[k]} ${images_folder[$k]}
echo "=> construction of ${area_ajs[$k]} OK"
......@@ -1238,7 +1238,7 @@ case ${sort_arg_keys[0]} in
state="RUN"
if [ $force == 'FALSE' ]; then
echo -e "=> \033[31mWARNING\033[0m : Missing one or more images or montages"
echo -e "=> ${RED}WARNING${COLOR_OFF} : Missing one or more images or montages"
fi
fi
......@@ -1345,7 +1345,7 @@ case ${sort_arg_keys[0]} in
else
echo -e "=> \033[32mINFOS\033[0m : Nothing to do for ${area_folder[$k]} all files are present"
echo -e "=> ${GREEN}INFOS${COLOR_OFF} : Nothing to do for ${area_folder[$k]} all files are present"
echo " "
fi
......@@ -1500,8 +1500,8 @@ case ${sort_arg_keys[0]} in
echo "-------------------------------------------------------------------"
echo " aladin stable versions available on :"
echo ""
echo -e "\033[31m- Aladin server : ${ALADIN_URL}\033[31m"
echo -e "\033[32m- Localhost\033[0m"
echo -e "${RED}- Aladin server : ${ALADIN_URL}${RED}"
echo -e "${GREEN}- Localhost${COLOR_OFF}"
echo "-------------------------------------------------------------------"
echo ""
......@@ -1509,12 +1509,12 @@ case ${sort_arg_keys[0]} in
for number_version in ${list_jar}
do
if [ -z $id_image ]; then
echo -e " \033[31m ${number_version}\033[0m"
echo -e " ${RED} ${number_version}${COLOR_OFF}"
else
if [ ${number_version} == ${ALADIN_VERSION} ]; then
echo -e " \033[32m *\033[0m \033[31m${number_version}\033[0m"
echo -e " ${GREEN} *${COLOR_OFF} ${RED}${number_version}${COLOR_OFF}"
else
echo -e " \033[31m ${number_version}\033[0m"
echo -e " ${RED} ${number_version}${COLOR_OFF}"
fi
fi
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment