Skip to content

Commit 4cb8f3f

Browse files
committed
Make function support normal lambda and runtime
1 parent dec984c commit 4cb8f3f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

runtime/layers/function/bootstrap

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
# Fail on error
44
set -e
55

6+
# if APP_RUNTIME does not exist
7+
if [[ -z "${APP_RUNTIME}" ]]; then
8+
BOOTSTRAP="/opt/bref/bootstrap.php"
9+
else
10+
# Split _HANDLER on ":" and take the first part
11+
BOOTSTRAP=(${_HANDLER//:/ })
12+
fi
13+
614
while true
715
do
816
# We redirect stderr to stdout so that everything
917
# written on the output ends up in Cloudwatch automatically
10-
/opt/bin/php "/opt/bref/bootstrap.php" 2>&1
18+
/opt/bin/php "${BOOTSTRAP}" 2>&1
1119
done

0 commit comments

Comments
 (0)