blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
24 stars 1 forks source link

build.sh: Include `get_yaml_entry` exported function for modules to utilize it #133

Closed fiftydinar closed 7 months ago

fiftydinar commented 7 months ago

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: https://github.com/ublue-os/bling/issues/131

xynydev commented 7 months ago

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"}".

fiftydinar commented 7 months ago

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"}".

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.