build.sh: Include `get_yaml_entry` exported function for modules to utilize it
Closed this issue · 2 comments
This function would be similar to already existing get_yaml_array
function, but it would be for entries only.
This would be useful, as we would not need to document quirks we discovered here:
#131
IMO, echo "$1" | yq -I=0 '.config.key
is pretty understandable already, and is documented on the module making page. The issue with adding new exported functions or variables is that not everyone updates their repository instantly. Those users trying to use a module that uses get_yaml_entry
would hit an error. This would necessitate redefining the function in modules where it is used just to prevent errors, similarly to MODULE_DIRECTORY="${MODULE_DIRECTORY:-"/tmp/modules"}"
.
IMO,
echo "$1" | yq -I=0 '.config.key
is pretty understandable already, and is documented on the module making page. The issue with adding new exported functions or variables is that not everyone updates their repository instantly. Those users trying to use a module that usesget_yaml_entry
would hit an error. This would necessitate redefining the function in modules where it is used just to prevent errors, similarly toMODULE_DIRECTORY="${MODULE_DIRECTORY:-"/tmp/modules"}"
.
I agree it's understandable, I just wanted to standardize this a bit.
I forgot about that scenario, you're right.
This can maybe be pulled of in this BlueBuild migration phase, but benefits are very small, so not sure if it's worth it to do do this.