chore: Remove usage of yq in favor of jq (#369)

* chore: Remove usage of `yq` in favor of `jq`

* fix: Missed bracket in `default-flatpaks`

* fix: `get_json_array` complaining about unpopulated arrays

* fix(files): Forgot to input `-r` flag for some `jq` calls

* fix(gschema-overrides): Use `try` in `get_json_array`

* chore(default-flatpaks): Replace `yq` with `jq` in run-time setup binaries

* chore: Switch to simplified `jq` syntax without brackets

* chore(default-flatpaks): Switch `repo-info` file from `yml` to `json`

* fix(default-flatpaks): Some `yq` calls

* chore: Revert back to bracket syntax for more reliable `jq` parsing

* chore(files): Missed bracket syntax

* chore: Approve bot suggestion about quoting

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update modules/files/files.sh

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(yafti): Populating custom flatpaks

It's populated in reverse order compared to the format in recipe, but it works

* fix(fonts): Variable substitution is needed

* fix: Typo

* fix(fonts): Forgot to assign FONTS variable

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
fiftydinar 2024-12-02 20:02:13 +01:00 committed by GitHub
parent ab654c9f16
commit 189048b119
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 90 additions and 88 deletions

View file

@ -39,42 +39,42 @@ fi
MODULE_DIRECTORY="${MODULE_DIRECTORY:-/tmp/modules}"
# Configuration values
AUTO_UPDATE=$(echo "${1}" | yq -I=0 ".auto-update")
AUTO_UPDATE=$(echo "${1}" | jq -r 'try .["auto-update"]')
if [[ -z "${AUTO_UPDATE}" || "${AUTO_UPDATE}" == "null" ]]; then
AUTO_UPDATE=true
fi
UPDATE_INTERVAL=$(echo "${1}" | yq -I=0 ".update-interval")
UPDATE_INTERVAL=$(echo "${1}" | jq -r 'try .["update-interval"]')
if [[ -z "${UPDATE_INTERVAL}" || "${UPDATE_INTERVAL}" == "null" ]]; then
UPDATE_INTERVAL="6h"
fi
UPDATE_WAIT_AFTER_BOOT=$(echo "${1}" | yq -I=0 ".update-wait-after-boot")
UPDATE_WAIT_AFTER_BOOT=$(echo "${1}" | jq -r 'try .["update-wait-after-boot"]')
if [[ -z "${UPDATE_WAIT_AFTER_BOOT}" || "${UPDATE_WAIT_AFTER_BOOT}" == "null" ]]; then
UPDATE_WAIT_AFTER_BOOT="10min"
fi
AUTO_UPGRADE=$(echo "${1}" | yq -I=0 ".auto-upgrade")
AUTO_UPGRADE=$(echo "${1}" | jq -r 'try .["auto-upgrade"]')
if [[ -z "${AUTO_UPGRADE}" || "${AUTO_UPGRADE}" == "null" ]]; then
AUTO_UPGRADE=true
fi
UPGRADE_INTERVAL=$(echo "$1" | yq -I=0 ".upgrade-interval")
UPGRADE_INTERVAL=$(echo "$1" | jq -r 'try .["upgrade-interval"]')
if [[ -z "${UPGRADE_INTERVAL}" || "${UPGRADE_INTERVAL}" == "null" ]]; then
UPGRADE_INTERVAL="8h"
fi
UPGRADE_WAIT_AFTER_BOOT=$(echo "${1}" | yq -I=0 ".upgrade-wait-after-boot")
UPGRADE_WAIT_AFTER_BOOT=$(echo "${1}" | jq -r 'try .["upgrade-wait-after-boot"]')
if [[ -z "${UPGRADE_WAIT_AFTER_BOOT}" || "${UPGRADE_WAIT_AFTER_BOOT}" == "null" ]]; then
UPGRADE_WAIT_AFTER_BOOT="30min"
fi
NOFILE_LIMITS=$(echo "${1}" | yq -I=0 ".nofile-limits")
NOFILE_LIMITS=$(echo "${1}" | jq -r 'try .["nofile-limits"]')
if [[ -z "${NOFILE_LIMITS}" || "${NOFILE_LIMITS}" == "null" ]]; then
NOFILE_LIMITS=false
fi
BREW_ANALYTICS=$(echo "${1}" | yq -I=0 ".brew-analytics")
BREW_ANALYTICS=$(echo "${1}" | jq -r 'try .["brew-analytics"]')
if [[ -z "${BREW_ANALYTICS}" || "${BREW_ANALYTICS}" == "null" ]]; then
BREW_ANALYTICS=true
fi