diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2019-10-16 00:13:46 -0500 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2019-10-16 00:13:46 -0500 |
commit | 04876c531d99b6a06c69490efb9379e96c43e162 (patch) | |
tree | 320c6eb1a18286134eb6552abe8fbaef33b5da4b /libs | |
parent | 444701d1ed3a8092fcf50861df12d9089e9241f0 (diff) | |
download | librebootfr-04876c531d99b6a06c69490efb9379e96c43e162.tar.gz librebootfr-04876c531d99b6a06c69490efb9379e96c43e162.zip |
libs/project: Call functions from any project
Helper functions, such as "arguments", provided by one project should
be callable from another project for more flexibility. Metaprojects in
particular could use this functionality.
In order for this to work, project_include() is used to create the
necessary environment separation (so defined functions are not
clobbered by the helper function).
Diffstat (limited to 'libs')
-rwxr-xr-x | libs/project | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/project b/libs/project index 2b6fc2fd..b9d33114 100755 --- a/libs/project +++ b/libs/project @@ -200,11 +200,15 @@ project_action_helper() { local project="$1" shift - if ! function_check "$helper"; then - return 0 - fi + ( + project_include "$project" - "$helper" "$@" + if ! function_check "$helper"; then + exit 0 + fi + + "$helper" "$@" + ) } project_action_arguments() { |