diff --git a/README.md b/README.md index d0d17fe..24d1ee9 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,6 @@ Copy the output image to your clipboard, so you can paste it anywhere. ```bash freeze main.go --output clipboard -freeze main.go --output copy ``` ### Font diff --git a/main.go b/main.go index 69a7cec..c5cd5f3 100644 --- a/main.go +++ b/main.go @@ -396,7 +396,7 @@ func main() { istty := isatty.IsTerminal(os.Stdout.Fd()) outputName := config.Output - if config.Output == "clipboard" || config.Output == "copy" { + if config.Output == "clipboard" { outputName = "clipboard.png" } switch { diff --git a/png.go b/png.go index fd3d4b1..c14c039 100644 --- a/png.go +++ b/png.go @@ -48,7 +48,7 @@ func libsvgConvert(doc *etree.Document, _, _ float64, output string) error { if err != nil { return err } - err = copyToClipboard(png) + return copyToClipboard(png) } return err //nolint: wrapcheck } @@ -114,10 +114,7 @@ func resvgConvert(doc *etree.Document, w, h float64, output string) error { } if output == "clipboard" { - err = copyToClipboard(png) - } else { - err = os.WriteFile(output, png, 0o600) + return copyToClipboard(png) } - - return err //nolint: wrapcheck + return os.WriteFile(output, png, 0o600) }