From 34079951ce9664472bac3676bedbe4fa288b8d63 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 25 May 2018 17:30:00 +0100 Subject: [PATCH] If there is no short description then don't include within android app --- src/freedombone-utils-android | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/freedombone-utils-android b/src/freedombone-utils-android index fd5256c4..117a8696 100755 --- a/src/freedombone-utils-android +++ b/src/freedombone-utils-android @@ -50,18 +50,18 @@ function android_update_apps { app_name=${APPS_INSTALLED_NAMES[$app_index]} app_filename="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}" if [ -f "$app_filename" ]; then - if [ $android_ctr -gt 0 ]; then - echo ',' >> "$plinth_api" - fi app_name_upper=$(echo "$app_name" | awk '{print toupper($0)}') "${app_name_upper}_SHORT_DESCRIPTION"= "${app_name_upper}_DESCRIPTION"= "${app_name_upper}_ICON_URL"= "${app_name_upper}_MOBILE_APP_URL"= - if grep -q "${app_name_upper}_SHORT_DESCRIPTION=" "$app_filename"; then - # shellcheck disable=SC2140 - "${app_name_upper}_SHORT_DESCRIPTION"="$(grep "${app_name_upper}_SHORT_DESCRIPTION=" "$app_filename" | head -n 1 | awk -F '=' '{print $2}')" + + if ! grep -q "${app_name_upper}_SHORT_DESCRIPTION=" "$app_filename"; then + continue fi + # shellcheck disable=SC2140 + "${app_name_upper}_SHORT_DESCRIPTION"="$(grep "${app_name_upper}_SHORT_DESCRIPTION=" "$app_filename" | head -n 1 | awk -F '=' '{print $2}')" + if grep -q "${app_name_upper}_DESCRIPTION=" "$app_filename"; then # shellcheck disable=SC2140 "${app_name_upper}_DESCRIPTION"="$(grep "${app_name_upper}_DESCRIPTION=" "$app_filename" | head -n 1 | awk -F '=' '{print $2}')" @@ -75,6 +75,10 @@ function android_update_apps { "${app_name_upper}_MOBILE_APP_URL"="$(grep "${app_name_upper}_MOBILE_APP_URL=" "$app_filename" | head -n 1 | awk -F '=' '{print $2}')" fi + if [ $android_ctr -gt 0 ]; then + echo ',' >> "$plinth_api" + fi + { echo ' {'; echo " \"name\": \"${app_name}\","; echo " \"short_description\": \"$((${app_name_upper}_SHORT_DESCRIPTION))\",";