diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 5aa95d3bf2..cd13ced759 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -719,7 +719,14 @@ class Builds extends Action } } - $command = 'tar -zxf /tmp/code.tar.gz -C /mnt/code && helpers/build.sh ' . \trim(\escapeshellarg($command)); + $userBuildCommand = $deployment->getAttribute('buildCommands', ''); + $logCommand = ''; + if (! empty($userBuildCommand)) { + $escapedForLog = \str_replace('$', '\\$', $userBuildCommand); + $logCommand = 'echo ' . \escapeshellarg('Build command: ' . $escapedForLog) . ' && '; + } + + $command = $logCommand . 'tar -zxf /tmp/code.tar.gz -C /mnt/code && helpers/build.sh ' . \trim(\escapeshellarg($command)); } $response = $executor->createRuntime(