diff --git a/bin/compose b/bin/compose index 8ef29a1..a81e29b 100755 --- a/bin/compose +++ b/bin/compose @@ -2404,12 +2404,18 @@ debug "Found $WHITE$exname$NORMAL YAML file in '$COMPOSE_YML_FILE'." output=$(shyaml get-value < "$COMPOSE_YML_FILE" 2>&1) if [ "$?" != 0 ]; then - err "Invalid YAML in '$COMPOSE_YML_FILE':" + outputed_something= while IFS='' read -r line1 && IFS='' read -r line2; do + [ "$outputed_something" ] || err "Invalid YAML in '$COMPOSE_YML_FILE':" + outputed_something=true echo "$line1 $GRAY($line2)$NORMAL" done < <(echo "$output" | grep ^yaml.scanner -A 100 | sed -r 's/^ in "", //g' | sed -r 's/^yaml.scanner.[a-zA-Z]+: //g') | prefix " $GRAY|$NORMAL " + [ "$outputed_something" ] || { + err "Unexpected error while running 'shyaml get-value' on '$COMPOSE_YML_FILE':" + echo "$output" | prefix " $GRAY|$NORMAL " + } exit 1 fi