From 4cb8f3fc17bffc401a4b9d630aef0a8f28fd5b87 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Mon, 20 Sep 2021 13:14:17 -0700 Subject: [PATCH] Make function support normal lambda and runtime --- runtime/layers/function/bootstrap | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/runtime/layers/function/bootstrap b/runtime/layers/function/bootstrap index 60376b00c..95e02aca5 100755 --- a/runtime/layers/function/bootstrap +++ b/runtime/layers/function/bootstrap @@ -3,9 +3,17 @@ # Fail on error set -e +# if APP_RUNTIME does not exist +if [[ -z "${APP_RUNTIME}" ]]; then + BOOTSTRAP="/opt/bref/bootstrap.php" +else + # Split _HANDLER on ":" and take the first part + BOOTSTRAP=(${_HANDLER//:/ }) +fi + while true do # We redirect stderr to stdout so that everything # written on the output ends up in Cloudwatch automatically - /opt/bin/php "/opt/bref/bootstrap.php" 2>&1 + /opt/bin/php "${BOOTSTRAP}" 2>&1 done