diff --git a/src/freedombone-utils-selector b/src/freedombone-utils-selector index e80ce4d6..80031bee 100755 --- a/src/freedombone-utils-selector +++ b/src/freedombone-utils-selector @@ -309,6 +309,11 @@ function detect_installable_apps { function choose_apps_for_variant { variant_name="$1" + if [ ${#variant_name} -eq 0 ]; then + echo $"No variant name for choosing apps" + exit 237567 + fi + FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* APPS_CHOSEN=() @@ -319,9 +324,7 @@ function choose_apps_for_variant { app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}') item_in_array "${app_name}" "${APPS_AVAILABLE[@]}" - if [[ $? != 0 ]]; then - APPS_AVAILABLE+=("${app_name}") - + if [[ $? == 0 ]]; then if grep -q "VARIANTS=" ${filename}; then variants_list=$(app_variants $filename) if [[ "${variants_list}" == 'all'* || \ @@ -341,7 +344,6 @@ function choose_apps_for_variant { else APPS_CHOSEN+=("0") fi - fi done