From b3f7f07d6ceca0489d699c6d2dfa4d995588c5c1 Mon Sep 17 00:00:00 2001 From: Eino Rauhala <60004820+EinoHR@users.noreply.github.com> Date: Wed, 26 Apr 2023 19:49:26 +0300 Subject: [PATCH] fix: only create yafti grp when flatpaks defined (#46) --- build.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index b7ef05c..350da18 100644 --- a/build.sh +++ b/build.sh @@ -23,9 +23,12 @@ echo "---" pip install --prefix=/usr yafti # add a package group for yafti using the packages defined in recipe.yml -yq -i '.screens.applications.values.groups.Custom.description = "Flatpaks defined by the image maintainer"' /usr/etc/yafti.yml -yq -i '.screens.applications.values.groups.Custom.default = true' /usr/etc/yafti.yml -flatpaks=$(yq '.flatpaks[]' < /usr/etc/ublue-recipe.yml) -for pkg in $(echo -e "$flatpaks"); do \ - yq -i ".screens.applications.values.groups.Custom.packages += [{\"$pkg\": \"$pkg\"}]" /usr/etc/yafti.yml -done +flatpaks=$(yq '.flatpaks[]' < /tmp/ublue-recipe.yml) +# only try to create package group if some flatpaks are defined +if [[ -n "$flatpaks" ]]; then + yq -i '.screens.applications.values.groups.Custom.description = "Flatpaks defined by the image maintainer"' /usr/etc/yafti.yml + yq -i '.screens.applications.values.groups.Custom.default = true' /usr/etc/yafti.yml + for pkg in $(echo -e "$flatpaks"); do \ + yq -i ".screens.applications.values.groups.Custom.packages += [{\"$pkg\": \"$pkg\"}]" /usr/etc/yafti.yml + done +fi \ No newline at end of file