From 4188bdc3ce9e1aeffd222f17813a09fbfd34424e Mon Sep 17 00:00:00 2001 From: GammaGames Date: Mon, 25 Nov 2024 11:59:10 -0700 Subject: [PATCH] capturing stdout --- entrypoint.sh | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 96ec81e..fca589b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -68,24 +68,10 @@ chmod +x ${TARGET} echo "======= CLI Version =======" sh -c "${TARGET} --version" # print version echo "===========================" -echo "STDOUT: $INPUT_CAPTURE_STDOUT" if [[ "$INPUT_CAPTURE_STDOUT" == 'true' ]]; then - _stdout=/dev/stdout - if [[ "$INPUT_CAPTURE_STDOUT" == 'true' ]]; then - _stdout=/tmp/_stdout - fi - - { - sh -c "${TARGET} $*" # run the command - } | tee $_stdout - - if [[ "$INPUT_CAPTURE_STDOUT" == 'true' ]]; then - echo "CAPTURING STDOUT $_stdout" - cat $_stdout - echo 'stdout<> $GITHUB_OUTPUT - cat $_stdout >> $GITHUB_OUTPUT - echo 'EOF' >> $GITHUB_OUTPUT - fi + echo 'stdout<> $GITHUB_OUTPUT # use a heredoc for multiline output + sh -c "${TARGET} $*" >> $GITHUB_OUTPUT # run the command + echo 'EOF' >> $GITHUB_OUTPUT else sh -c "${TARGET} $*" # run the command fi