Commit 951c45ef authored by Julien Penguen's avatar Julien Penguen
Browse files

correction version macosx

parent 6349d7d9
......@@ -21,20 +21,20 @@ function_message()
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[31m========================================================="
echo -e "WARNING => ${message}"
echo -e "=========================================================\033[0m"
echo "\033[31m========================================================="
echo "WARNING => ${message}"
echo "=========================================================\033[0m"
elif [ "$type_message" == "TYPE_FILE_ERROR" ]; then
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[31m========================================================="
echo -e " ERROR with option '${option}' "
echo -e ""
echo -e "${message}"
echo -e "=========================================================\033[0m"
echo "\033[31m========================================================="
echo " ERROR with option '${option}' "
echo ""
echo "${message}"
echo "=========================================================\033[0m"
echo ""
echo "------------------------------------"
......@@ -43,11 +43,11 @@ function_message()
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[31m========================================================="
echo -e " ERROR with option '${option}' "
echo -e ""
echo -e "${message}"
echo -e "=========================================================\033[0m"
echo "\033[31m========================================================="
echo " ERROR with option '${option}' "
echo ""
echo "${message}"
echo "=========================================================\033[0m"
echo ""
echo "------------------------------------"
......@@ -56,22 +56,22 @@ function_message()
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[32m========"
echo -e "= HELP ="
echo -e "========\033[0m"
echo "\033[32m========"
echo "= HELP ="
echo "========\033[0m"
elif [ "$type_message" == "TYPE_UNKNOWN" ]; then
echo ""
echo -e "\033[31m==============================="
echo -e " error: unrecognized arguments "
echo -e "===============================\033[0m"
echo "\033[31m==============================="
echo " error: unrecognized arguments "
echo "===============================\033[0m"
elif [ "$type_message" == "TYPE_EXIST_VERSION" ]; then
echo ''
echo -e "\033[31m===================================="
echo -e " WARNING"
echo -e "====================================\033[0m"
echo "\033[31m===================================="
echo " WARNING"
echo "====================================\033[0m"
echo ''
echo '------------------------------------'
echo ''
......@@ -90,9 +90,9 @@ function_message()
elif [ "$type_message" == "TYPE_FORCE_WARNING" ]; then
echo ''
echo -e "\033[31m===================================="
echo -e " WARNING"
echo -e "====================================\033[0m"
echo "\033[31m===================================="
echo " WARNING"
echo "====================================\033[0m"
echo ''
echo '------------------------------------'
echo ''
......@@ -108,9 +108,9 @@ function_message()
elif [ "$type_message" == "TYPE_DELETE_EXIST_VERSION" ]; then
echo ''
echo -e "\033[31m===================================="
echo -e " WARNING"
echo -e "====================================\033[0m"
echo "\033[31m===================================="
echo " WARNING"
echo "====================================\033[0m"
echo ''
echo '------------------------------------'
echo ''
......@@ -637,7 +637,8 @@ function_check_number()
var=$1
if [[ $var = +([0-9]) ]] ; then
#if [[ $var = +([0-9]) ]] ; then
if [[ $var =~ ^[+]?[0-9]+$ ]] ; then
reponse="TRUE"
else
......@@ -821,16 +822,16 @@ done
RESULTAT=`function_build_tab_hach $@`
tab_arg_keys=`echo $RESULTAT | cut --delimiter=, -f 1`
tab_arg_values=`echo $RESULTAT | cut --delimiter=, -f 2`
tab_arg_weight=`echo $RESULTAT | cut --delimiter=, -f 3`
val_error=`echo $RESULTAT | cut --delimiter=, -f 4`
tab_arg_keys=`echo $RESULTAT | cut -d "," -f 1`
tab_arg_values=`echo $RESULTAT | cut -d "," -f 2`
tab_arg_weight=`echo $RESULTAT | cut -d "," -f 3`
val_error=`echo $RESULTAT | cut -d "," -f 4`
#------------------------------------#
#check if val_error is TRUE
if [ $val_error == "TRUE" ]; then
error_message=`echo $RESULTAT | cut --delimiter=, -f 5`
error_message=`echo $RESULTAT | cut -d "," -f 5`
function_message "TYPE_VAL_ERROR" "${error_message}"
exit 0
......@@ -842,9 +843,9 @@ fi
RESULT_CHECK_SELECT=`function_check_select_option "${tab_arg_keys[*]}" "${tab_arg_values[*]}" "${tab_arg_weight[*]}"`
array_arg_keys=`echo $RESULT_CHECK_SELECT | cut --delimiter=, -f 1`
array_arg_values=`echo $RESULT_CHECK_SELECT | cut --delimiter=, -f 2`
array_arg_weight=`echo $RESULT_CHECK_SELECT | cut --delimiter=, -f 3`
array_arg_keys=`echo $RESULT_CHECK_SELECT | cut -d "," -f 1`
array_arg_values=`echo $RESULT_CHECK_SELECT | cut -d "," -f 2`
array_arg_weight=`echo $RESULT_CHECK_SELECT | cut -d "," -f 3`
arg_keys=( ${array_arg_keys// / } )
arg_values=( ${array_arg_values// / } )
......@@ -857,9 +858,9 @@ arg_weight=( ${array_arg_weight// / } )
RESULT_SORT=`function_sort_tab "${arg_keys[*]}" "${arg_values[*]}" "${arg_weight[*]}"`
tab_sort_arg_keys=`echo $RESULT_SORT | cut --delimiter=, -f 1`
tab_sort_arg_values=`echo $RESULT_SORT | cut --delimiter=, -f 2`
tab_sort_arg_weight=`echo $RESULT_SORT | cut --delimiter=, -f 3`
tab_sort_arg_keys=`echo $RESULT_SORT | cut -d "," -f 1`
tab_sort_arg_values=`echo $RESULT_SORT | cut -d "," -f 2`
tab_sort_arg_weight=`echo $RESULT_SORT | cut -d "," -f 3`
sort_arg_keys=( ${tab_sort_arg_keys// / } )
sort_arg_values=( ${tab_sort_arg_values// / } )
......@@ -1282,9 +1283,23 @@ case ${sort_arg_keys[0]} in
#construction of docker script and montage
echo "=> Construction in progress ..."
new_main_folder="/home/"$USER"/.photos_montage_aladin"
new_area_folder[$k]=${new_main_folder}"/"${list_zone[$k]}
new_tempo_folder[$k]=${new_area_folder[$k]}
new_images_folder[$k]=${new_area_folder[$k]}"/images"
new_montages_folder[$k]=${new_area_folder[$k]}"/montages"
new_area_ajs[$k]=${new_tempo_folder[$k]}"/area_"${list_zone[$k]}".ajs"
#new_log_aladin_file[$k]=${new_area_folder[$k]}"/"${list_zone[$k]}".log"
#------------------------#
script_images[$k]="macro "${new_area_ajs[$k]}
script_montages[$k]="montage -geometry ${RESOLUTION_BY_LINE}x${RESOLUTION_BY_COL} -tile ${NB_TILE_BY_LINE}x${NB_TILE_BY_COL} ${new_images_folder[$k]}/*jpg ${new_montages_folder[$k]}/${list_zone[$k]}.png"
#------------------------#
script_images[$k]="macro "${area_ajs[$k]}
script_montages[$k]="montage -geometry ${RESOLUTION_BY_LINE}x${RESOLUTION_BY_COL} -tile ${NB_TILE_BY_LINE}x${NB_TILE_BY_COL} ${images_folder[$k]}/*jpg ${montages_folder[$k]}/${list_zone[$k]}.png"
#script_images[$k]="macro "${area_ajs[$k]}
#script_montages[$k]="montage -geometry ${RESOLUTION_BY_LINE}x${RESOLUTION_BY_COL} -tile ${NB_TILE_BY_LINE}x${NB_TILE_BY_COL} ${images_folder[$k]}/*jpg ${montages_folder[$k]}/${list_zone[$k]}.png"
xhost +
if [[ "${sort_arg_keys[@]}" =~ "--mount" && $VOLUME_MOUNT != "NONE" ]]; then
......
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