From 605ee2f7c58de61110cb7f1c689e8157245ad2d1 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Sat, 2 Sep 2023 22:44:10 -0700 Subject: [PATCH] Update create deployment default commands Default to function commands only if commands weren't supplied. --- app/controllers/api/functions.php | 4 +--- src/Appwrite/Migration/Version/V19.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index bbdd12c85f..5c8499cdf3 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1062,11 +1062,9 @@ App::post('/v1/functions/:functionId/deployments') } if ($commands === null) { - $commands = $function->getAttribute('entrypoint', ''); + $commands = $function->getAttribute('commands', ''); } - $commands = $function->getAttribute('commands', ''); - if (empty($entrypoint)) { throw new Exception(Exception::FUNCTION_ENTRYPOINT_MISSING); } diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index d5011909ce..e7cef65738 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -615,7 +615,7 @@ class V19 extends Migration { $runtime = $function->getAttribute('runtime'); $language = explode('-', $runtime)[0]; - $commands = match($language) { + $commands = match ($language) { 'dart' => 'dart pub get', 'deno' => 'deno cache ' . $function->getAttribute('entrypoint'), 'dotnet' => 'dotnet restore',