From 3aab691cf8e48e3c117aef622aafbb2241e9aa79 Mon Sep 17 00:00:00 2001 From: Chris Hubbard Date: Fri, 25 Aug 2023 11:23:58 -0400 Subject: [PATCH] Fix generating asset preview html --- .../views/cron/scripts/upload/default/build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/application/console/views/cron/scripts/upload/default/build.sh b/application/console/views/cron/scripts/upload/default/build.sh index fa0a6d9..4911cb1 100644 --- a/application/console/views/cron/scripts/upload/default/build.sh +++ b/application/console/views/cron/scripts/upload/default/build.sh @@ -259,8 +259,16 @@ set_default_asset_package() { echo "Updating ipa-app-type=assets" echo "Updating ipa-asset-filename=${ASSET_FILENAME}" echo "Project=${PROJECT_DIR}/build.appDef" - xmlstarlet ed --inplace -s "/app-definition" -t elem -n "ipa-app-type" -v "assets" "${PROJECT_DIR}/build.appDef" - xmlstarlet ed --inplace -s "/app-definition" -t elem -n "ipa-asset-filename" -v "${ASSET_FILENAME}" "${PROJECT_DIR}/build.appDef" + if grep -q "" "${PROJECT_DIR}/build.appDef"; then + xmlstarlet ed --inplace -u "/app-definition/ipa-app-type" -v "assets" "${PROJECT_DIR}/build.appDef" + else + xmlstarlet ed --inplace -s "/app-definition" -t elem -n "ipa-app-type" -v "assets" "${PROJECT_DIR}/build.appDef" + fi + if grep -q "" "${PROJECT_DIR}/build.appDef"; then + xmlstarlet ed --inplace -u "/app-definition/ipa-asset-filename" -v "${ASSET_FILENAME}" "${PROJECT_DIR}/build.appDef" + else + xmlstarlet ed --inplace -s "/app-definition" -t elem -n "ipa-asset-filename" -v "${ASSET_FILENAME}" "${PROJECT_DIR}/build.appDef" + fi } build_asset_package() {