From 33ab88f7940b6e360d3e8d7f4a1b0b393547dd92 Mon Sep 17 00:00:00 2001 From: Arcitec <38923130+Arcitec@users.noreply.github.com> Date: Tue, 9 May 2023 18:36:27 +0200 Subject: [PATCH] feat: add function for reading individual YAML strings The recipe file is now also moved to a separate variable, and we use `--` to ensure that yq never misinterprets any custom arguments as `-flags`. --- build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 4180f07..a5bf635 100644 --- a/build.sh +++ b/build.sh @@ -4,8 +4,12 @@ set -oue pipefail # Helper functions. +RECIPE_FILE="/usr/etc/ublue-recipe.yml" get_yaml_array() { - mapfile -t "$1" < <(yq "$2" < /usr/etc/ublue-recipe.yml) + mapfile -t "$1" < <(yq -- "$2" "$RECIPE_FILE") +} +get_yaml_string() { + yq -- "$1" "$RECIPE_FILE" } # Add custom repos.