From 9b4f787d404075da943608d3f9ee3ee1a356be40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 18 May 2025 11:08:14 +0200 Subject: [PATCH] Fix edge case with no commands --- src/Appwrite/Platform/Modules/Functions/Workers/Builds.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 1b3e1a8af9..dff7e7f3f3 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -661,7 +661,12 @@ class Builds extends Action } else { if ($resource->getCollection() === 'sites') { $listFilesCommand = 'echo "{APPWRITE_DETECTION_SEPARATOR}" && cd /usr/local/build && cd $OPEN_RUNTIMES_OUTPUT_DIRECTORY && find . -name \'node_modules\' -prune -o -type f -print'; - $command .= '&& ' . $listFilesCommand; + + if (empty($command)) { + $command = $listFilesCommand; + } else { + $command .= ' && ' . $listFilesCommand; + } } $command = 'tar -zxf /tmp/code.tar.gz -C /mnt/code && helpers/build.sh ' . \trim(\escapeshellarg($command));