Skip to content

Commit

Permalink
fix: Remove trailing newlines from yaml arrays (#73)
Browse files Browse the repository at this point in the history
Trailing newlines is something that we will never need as an
information, so it can only cause issues with parsing yaml values.

I scratched my head for 10 minutes on why my variable has a trailing
newline when I use `readarray -t` everywhere. Then I remembered
get_yaml_array function.

This should not affect current working modules at all, but it would be
good to test before landing.

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
  • Loading branch information
fiftydinar and gmpinder authored Feb 20, 2024
1 parent 2a85c27 commit 411e782
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/export.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

get_yaml_array() {
readarray "$1" < <(echo "$3" | yq -I=0 "$2")
readarray -t "$1" < <(echo "$3" | yq -I=0 "$2")
}

export -f get_yaml_array
Expand Down

0 comments on commit 411e782

Please sign in to comment.