From f0709ff410ed80cb2d3303f1b226ded5b4baf032 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 8 May 2025 12:44:55 +0300 Subject: [PATCH] Fix 'prepare' function running in source directory during compilation --- src/bpmlib/compilation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bpmlib/compilation.go b/src/bpmlib/compilation.go index 6e72b2c..f35b431 100644 --- a/src/bpmlib/compilation.go +++ b/src/bpmlib/compilation.go @@ -143,7 +143,7 @@ func CompileSourcePackage(archiveFilename, outputDirectory string, skipChecks bo "set -a\n"+ // Source and export functions and variables in source.sh script ". \"${BPM_WORKDIR}\"/source.sh\n"+ "set +a\n"+ - "[[ $(type -t prepare) == \"function\" ]] && { echo \"Running prepare() function\"; bash -e -c 'cd \"$BPM_SOURCE\" && prepare' || exit 1; }\n"+ // Run prepare() function if it exists + "[[ $(type -t prepare) == \"function\" ]] && { echo \"Running prepare() function\"; bash -e -c 'cd \"$BPM_WORKDIR\" && prepare' || exit 1; }\n"+ // Run prepare() function if it exists "[[ $(type -t build) == \"function\" ]] && { echo \"Running build() function\"; bash -e -c 'cd \"$BPM_SOURCE\" && build' || exit 1; }\n"+ // Run build() function if it exists "exit 0") cmd.Dir = tempDirectory