From 0308cc02c9383880a270e03a1945365c0059e3f8 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 9 Jun 2019 20:46:37 -0400 Subject: 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). --- libs/project | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libs') 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() { -- cgit v1.2.3-70-g09d2