Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
feat: add function for reading individual YAML strings
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
Arcitec authored and xynydev committed May 10, 2023
1 parent bf19fa5 commit 33ab88f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 33ab88f

Please sign in to comment.