Closed aniongithub closed 2 years ago
Thank you very much for your contribution! I like the idea of a more native feeling way to extend or include other Pifiles.
However, with your current approach, all INCLUDE
d files will only be sourced in the 10-setup
stage, as in every other stage the INCLUDE
function does nothing. This results in the included Pifile being only sourced once, with only the 10-setup
functions being available.
The current stage logic is implemented in a very straight forward way with a code block like the following for each of the four stages: https://github.com/Nature40/pimod/blob/a75017b8e038ff2a35279c620f2dd1ad6ad0a1e0/modules/pifile.sh#L36-L43 Thus, only the stage's commands have an implementation during the stage.
As one wants to extend another Pifile with all its stages, your INCLUDE
command should be available for all of those. The most easy way would be to implement its function only within the 00-commands.sh
file, as it is sourced first for every stage.
Would you please also add a brief description of the command to the README.md
?
Thanks again!
Incorporated the suggested changes. Thanks!
Done, updated according to suggestions!
The one CI error appears due to the unavailability of INCLUDE
on the current master
branch.
To include other Pifiles, it's easy to use the
source
command, but this detracts from the Dockerfile-like nature of pimod. TheINCLUDE
command lets us do this, while ensuring that only Pifiles can be included (it appends a.Pifile
to the provided filename).