mirror of
https://github.com/optim-enterprises-bv/secureblue.git
synced 2025-11-04 12:28:04 +00:00
refactor: export get_yaml_array
This commit is contained in:
1
build.sh
1
build.sh
@@ -11,6 +11,7 @@ MODULE_DIRECTORY="/tmp/modules"
|
|||||||
get_yaml_array() {
|
get_yaml_array() {
|
||||||
readarray "$1" < <(yq -o=j -I=0 "$2" "$RECIPE_FILE" )
|
readarray "$1" < <(yq -o=j -I=0 "$2" "$RECIPE_FILE" )
|
||||||
}
|
}
|
||||||
|
export -f get_yaml_array
|
||||||
|
|
||||||
# Automatically determine which Fedora version we're building.
|
# Automatically determine which Fedora version we're building.
|
||||||
FEDORA_VERSION="$(grep -Po '(?<=VERSION_ID=)\d+' /usr/lib/os-release)"
|
FEDORA_VERSION="$(grep -Po '(?<=VERSION_ID=)\d+' /usr/lib/os-release)"
|
||||||
|
|||||||
@@ -3,10 +3,9 @@
|
|||||||
# Tell build process to exit if there are any errors.
|
# Tell build process to exit if there are any errors.
|
||||||
set -oue pipefail
|
set -oue pipefail
|
||||||
|
|
||||||
readarray RUN < <(yq -o=j -I=0 '.run[]' "$1" )
|
|
||||||
|
|
||||||
cd "$CONFIG_DIRECTORY/scripts"
|
cd "$CONFIG_DIRECTORY/scripts"
|
||||||
|
|
||||||
|
get_yaml_array RUN '.run[]'
|
||||||
for CMD in "${RUN[@]}"; do
|
for CMD in "${RUN[@]}"; do
|
||||||
echo "Running command: $CMD"
|
echo "Running command: $CMD"
|
||||||
$CMD
|
$CMD
|
||||||
|
|||||||
Reference in New Issue
Block a user