1
0
Fork 0
mirror of synced 2024-10-01 01:37:56 +13:00

Update create deployment default commands

Default to function commands only if commands weren't supplied.
This commit is contained in:
Steven Nguyen 2023-09-02 22:44:10 -07:00
parent 87b0851092
commit 605ee2f7c5
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View file

@ -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);
}

View file

@ -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',