From 04876c531d99b6a06c69490efb9379e96c43e162 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Wed, 16 Oct 2019 00:13:46 -0500 Subject: 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). --- libs/project | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'libs/project') 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() { -- cgit v1.2.3-70-g09d2