Skip to content

Commit 4adbccb

Browse files
committed
fix(utils/utils): use color.Output to handle escape sequence on Windows
1 parent d0d473a commit 4adbccb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ func download(videoURL string) error {
193193
}
194194

195195
func printError(url string, err error) {
196-
fmt.Printf(
196+
fmt.Fprintf(
197+
color.Output,
197198
"Downloading %s error:\n%s\n",
198199
color.CyanString("%s", url), color.RedString("%v", err),
199200
)

utils/utils.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ func M3u8URLs(uri string) ([]string, error) {
258258
func PrintVersion() {
259259
blue := color.New(color.FgBlue)
260260
cyan := color.New(color.FgCyan)
261-
fmt.Printf(
261+
fmt.Fprintf(
262+
color.Output,
262263
"\n%s: version %s, A fast, simple and clean video downloader.\n\n",
263264
cyan.Sprintf("annie"),
264265
blue.Sprintf(config.VERSION),

0 commit comments

Comments
 (0)