From e9c3938982a0057a1fcd78e589f45dd278eaee5e Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 13:44:11 -0500 Subject: [PATCH] fix tty issues --- lib/worker.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/worker.sh b/lib/worker.sh index 29074246..1beed4aa 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -229,6 +229,14 @@ function LintCodebase() { R --slave -e "errors <- lintr::lint('$FILE');print(errors);quit(save = 'no', status = if (length(errors) > 0) 1 else 0)" 2>&1 ) #LINTER_COMMAND="lintr::lint('${FILE}')" + ######################################################### + # Corner case for C# as it writes to tty and not stdout # + ######################################################### + elif [[ ${FILE_TYPE} == "CSHARP" ]]; then + LINT_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit + ${LINTER_CMD} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" + ) else ################################ # Lint the file with the rules # @@ -468,6 +476,14 @@ function TestCodebase() { cd "${GITHUB_WORKSPACE}" || exit R --slave -e "errors <- lintr::lint('$FILE');print(errors);quit(save = 'no', status = if (length(errors) > 0) 1 else 0)" 2>&1 ) + ######################################################### + # Corner case for C# as it writes to tty and not stdout # + ######################################################### + elif [[ ${FILE_TYPE} == "CSHARP" ]]; then + LINT_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit + ${LINTER_CMD} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" + ) else ################################ # Lint the file with the rules #