Fix choosing of apps

This commit is contained in:
Bob Mottram 2016-10-15 11:03:52 +01:00
parent 4acad83e9c
commit ef471e69c8
1 changed files with 6 additions and 4 deletions

View File

@ -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