diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2019-06-09 20:46:37 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2019-07-21 14:03:20 -0500 |
commit | 0308cc02c9383880a270e03a1945365c0059e3f8 (patch) | |
tree | e3281e8f7a76a5b3eca696e2b674b488d972864e /libs | |
parent | b46680c8c15d8e84745f467035ca5e54262f2833 (diff) | |
download | librebootfr-0308cc02c9383880a270e03a1945365c0059e3f8.tar.gz librebootfr-0308cc02c9383880a270e03a1945365c0059e3f8.zip |
libs/project: Invoke subshell in project_function_check()
Since we're doing a simple check to see if a function exists in a
given project's scripts we should only source those files into a
subshell (so any changes to the environment are discarded once the
subshell exits).
Diffstat (limited to 'libs')
-rwxr-xr-x | libs/project | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libs/project b/libs/project index b130af17..2b6fc2fd 100755 --- a/libs/project +++ b/libs/project @@ -126,14 +126,13 @@ project_function_check() { local project=$1 local function=$2 - project_include "$project" - - if ! function_check "$function" - then - return 1 - fi + ( + project_include "$project" - return 0 + if ! function_check "$function"; then + exit 1 + fi + ) } project_action() { |