mc cp -continue: Fix escape/colorization of JSON (#3116)

This commit is contained in:
Klaus Post
2020-03-13 13:21:39 -07:00
committed by GitHub
parent 1092f6932f
commit 1a27f7f51d
+3 -3
View File
@@ -19,6 +19,7 @@ package cmd
import (
"bufio"
"context"
"encoding/json"
"errors"
"fmt"
"io"
@@ -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"
)
@@ -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())
}