From 3fa84aa42866c72671d8df385cbcc89d4d785e92 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 29 Sep 2016 11:19:01 +0100 Subject: [PATCH] Handle single or double quotes --- src/freedombone-utils-selector | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/freedombone-utils-selector b/src/freedombone-utils-selector index 0f3d3b4b..91f8f919 100755 --- a/src/freedombone-utils-selector +++ b/src/freedombone-utils-selector @@ -93,8 +93,6 @@ function detect_apps { fi done - echo "Apps available: $APPS_AVAILABLE" - function_check get_apps_installed get_apps_installed get_apps_installed_names @@ -118,10 +116,13 @@ function choose_apps_for_variant { APPS_AVAILABLE+=("${app_name}") if grep -q "VARIANTS=" ${filename}; then - variants_list="$(cat ${filename} | grep "VARIANTS=" | awk -F '=' '{print $2}' | awk -F "'" '{print $2}')" + variants_line=$(cat ${filename} | grep "VARIANTS=") + if [[ "$variants_line" == *"'"* ]]; then + variants_list=$(echo "$variants_line" | awk -F '=' '{print $2}' | awk -F "'" '{print $2}') + else + variants_list=$(echo "$variants_line" | awk -F '=' '{print $2}' | awk -F '"' '{print $2}') + fi if [[ "${variants_list}" == 'all'* || \ - "${variants_list}" == 'any'* || \ - "${variants_list}" == 'full'* || \ "${variants_list}" == "$variant_name "* || \ "${variants_list}" == *" $variant_name "* || \ "${variants_list}" == *" $variant_name" ]]; then