From b7844e98983b84450cd4c6edb88c9b4db3da9d04 Mon Sep 17 00:00:00 2001 From: Travis Reeder Date: Thu, 6 Oct 2016 11:24:50 -0700 Subject: [PATCH] Checks env var first, then stdin. --- examples/hello/VERSION | 2 +- examples/hello/hello.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/hello/VERSION b/examples/hello/VERSION index 369bd4c2a..f092e2be2 100644 --- a/examples/hello/VERSION +++ b/examples/hello/VERSION @@ -1 +1 @@ -0.0.29 +0.0.30 diff --git a/examples/hello/hello.rb b/examples/hello/hello.rb index c10c55651..1deab24a6 100644 --- a/examples/hello/hello.rb +++ b/examples/hello/hello.rb @@ -2,7 +2,10 @@ require 'json' name = "World" -payload = STDIN.read +payload = ENV['PAYLOAD'] +if payload == nil || payload == "" + payload = STDIN.read +end STDERR.puts 'payload: ' + payload.inspect if payload != ""