Skip to content

Commit

Permalink
Fix bug with running program without output file
Browse files Browse the repository at this point in the history
  • Loading branch information
ksysoev committed Dec 10, 2023
1 parent 93dcc4e commit 4414fe9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/command/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"fmt"
"io"
"reflect"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -167,7 +168,7 @@ func (c *PrintMsg) Execute(exCtx ExecutionContext) (Executer, error) {

fmt.Fprintf(exCtx.Output(), "%s\n", output)

if exCtx.OutputFile() != nil {
if !reflect.ValueOf(exCtx.OutputFile()).IsNil() {
output, err := exCtx.Formater().FormatForFile(msg)
if err != nil {
return nil, err
Expand Down

0 comments on commit 4414fe9

Please sign in to comment.