fix(default-flatpaks): Default notify value not properly set

Fixes:
https://github.com/blue-build/modules/issues/268
This commit is contained in:
fiftydinar 2024-09-17 09:10:15 +02:00
parent 047d3a4f0b
commit 54d27a1f9d
2 changed files with 7 additions and 3 deletions

View file

@ -18,7 +18,7 @@ The scripts are run on every boot by these services:
This module stores the Flatpak remote configuration and Flatpak install/remove lists in `/usr/share/bluebuild/default-flatpaks/`. There are two subdirectories, `user` and `system` corresponding with the install level of the Flatpaks and repositories. Each directory has text files containing the IDs of flatpaks to `install` and `remove`, plus a `repo-info.yml` containing the details of the Flatpak repository.
This module also supports disabling & enabling notifications.
This module also supports disabling & enabling notifications. If not specified in the recipe, notifications are disabled by default.
## Local modification

View file

@ -180,8 +180,12 @@ check_flatpak_id_validity_from_flathub "${1}" "user"
echo "Configuring default-flatpaks notifications"
NOTIFICATIONS=$(echo "$1" | yq -I=0 ".notify")
CONFIG_NOTIFICATIONS="/usr/share/bluebuild/default-flatpaks/notifications"
cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/notifications "$CONFIG_NOTIFICATIONS"
echo "$NOTIFICATIONS" >> "$CONFIG_NOTIFICATIONS"
cp -r "${MODULE_DIRECTORY}/default-flatpaks/config/notifications" "${CONFIG_NOTIFICATIONS}"
if [[ -z "${NOTIFICATIONS}" ]] || [[ "${NOTIFICATIONS}" == "null" ]]; then
echo "false" >> "${CONFIG_NOTIFICATIONS}"
else
echo "${NOTIFICATIONS}" >> "${CONFIG_NOTIFICATIONS}"
fi
echo "Copying user modification template files"