Skip to content

Commit

Permalink
fix: handle debug output messing up jbangdev
Browse files Browse the repository at this point in the history
  • Loading branch information
essobedo committed Oct 5, 2023
1 parent d0d2a49 commit d08a962
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/scripts/jbang
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ export JBANG_STDIN_NOTTY=$([ -t 0 ] && echo "false" || echo "true")
output=$(CLICOLOR_FORCE=1 "${JAVA_EXEC}" ${JBANG_JAVA_OPTIONS} -classpath "${jarPath}" dev.jbang.Main "$@")
err=$?
if [ $err -eq 255 ]; then
nl=$'\n'
if [[ $output =~ $nl ]]; then
## keep the last output line to avoid being polluted by the potential verbosity of the JVM
output=$(echo "$output" | tail -1)
fi
eval "exec $output"
elif [ -n "$output" ]; then
echo "$output"
Expand Down

0 comments on commit d08a962

Please sign in to comment.