If there is no short description then don't include within android app

This commit is contained in:
Bob Mottram 2018-05-25 17:30:00 +01:00
parent dad0b391f5
commit 34079951ce
1 changed files with 10 additions and 6 deletions

View File

@ -50,18 +50,18 @@ function android_update_apps {
app_name=${APPS_INSTALLED_NAMES[$app_index]} app_name=${APPS_INSTALLED_NAMES[$app_index]}
app_filename="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}" app_filename="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"
if [ -f "$app_filename" ]; then 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=$(echo "$app_name" | awk '{print toupper($0)}')
"${app_name_upper}_SHORT_DESCRIPTION"= "${app_name_upper}_SHORT_DESCRIPTION"=
"${app_name_upper}_DESCRIPTION"= "${app_name_upper}_DESCRIPTION"=
"${app_name_upper}_ICON_URL"= "${app_name_upper}_ICON_URL"=
"${app_name_upper}_MOBILE_APP_URL"= "${app_name_upper}_MOBILE_APP_URL"=
if grep -q "${app_name_upper}_SHORT_DESCRIPTION=" "$app_filename"; then
if ! grep -q "${app_name_upper}_SHORT_DESCRIPTION=" "$app_filename"; then
continue
fi
# shellcheck disable=SC2140 # shellcheck disable=SC2140
"${app_name_upper}_SHORT_DESCRIPTION"="$(grep "${app_name_upper}_SHORT_DESCRIPTION=" "$app_filename" | head -n 1 | awk -F '=' '{print $2}')" "${app_name_upper}_SHORT_DESCRIPTION"="$(grep "${app_name_upper}_SHORT_DESCRIPTION=" "$app_filename" | head -n 1 | awk -F '=' '{print $2}')"
fi
if grep -q "${app_name_upper}_DESCRIPTION=" "$app_filename"; then if grep -q "${app_name_upper}_DESCRIPTION=" "$app_filename"; then
# shellcheck disable=SC2140 # shellcheck disable=SC2140
"${app_name_upper}_DESCRIPTION"="$(grep "${app_name_upper}_DESCRIPTION=" "$app_filename" | head -n 1 | awk -F '=' '{print $2}')" "${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}')" "${app_name_upper}_MOBILE_APP_URL"="$(grep "${app_name_upper}_MOBILE_APP_URL=" "$app_filename" | head -n 1 | awk -F '=' '{print $2}')"
fi fi
if [ $android_ctr -gt 0 ]; then
echo ',' >> "$plinth_api"
fi
{ echo ' {'; { echo ' {';
echo " \"name\": \"${app_name}\","; echo " \"name\": \"${app_name}\",";
echo " \"short_description\": \"$((${app_name_upper}_SHORT_DESCRIPTION))\","; echo " \"short_description\": \"$((${app_name_upper}_SHORT_DESCRIPTION))\",";