Skip to content

Commit

Permalink
mc cp -continue: Fix escape/colorization of JSON (#3116)
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost authored Mar 13, 2020
1 parent 1092f69 commit 1a27f7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/cp-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cmd
import (
"bufio"
"context"
"encoding/json"
"errors"
"fmt"
"io"
Expand All @@ -30,7 +31,6 @@ import (

"github.com/fatih/color"
"github.com/minio/cli"
json "github.com/minio/mc/pkg/colorjson"
"github.com/minio/mc/pkg/probe"
"github.com/minio/minio/pkg/console"
)
Expand Down Expand Up @@ -275,8 +275,8 @@ func doPrepareCopyURLs(session *sessionV8, trapCh <-chan bool, cancelCopy contex
session.Delete()
fatalIf(probe.NewError(e), "Unable to prepare URL for copying. Error in JSON marshaling.")
}

fmt.Fprintln(dataFP, string(jsonData))
dataFP.Write(jsonData)
dataFP.Write([]byte{'\n'})
if !globalQuiet && !globalJSON {
scanBar(cpURLs.SourceContent.URL.String())
}
Expand Down

0 comments on commit 1a27f7f

Please sign in to comment.