diff --git a/README.md b/README.md index 4fc024b1..14968b21 100644 --- a/README.md +++ b/README.md @@ -1104,6 +1104,10 @@ $ docker run --rm script 1 2 3 Your command line args: (1 2 3) ``` +## Package babashka script as a AWS Lambda + +AWS Lambda runtime doesn't support signals, therefore babashka has to disable handling of the SIGPIPE. This can be done by setting `BABASHKA_DISABLE_PIPE_HANDLER` to `true`. + ## Thanks - [adgoji](https://www.adgoji.com/) for financial support diff --git a/src/babashka/main.clj b/src/babashka/main.clj index 3f9d1d37..2e6ec6b6 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -289,7 +289,8 @@ Everything after that is bound to *command-line-args*.")) (defn main [& args] - (handle-pipe!) + (when-not (Boolean/valueOf ^String (System/getenv "BABASHKA_DISABLE_PIPE_HANDLER")) + (handle-pipe!)) #_(binding [*out* *err*] (prn "M" (meta (get bindings 'future)))) (binding [*unrestricted* true]