Skip to content

Commit 87af18f

Browse files
committed
feat(clipboard): remove copy as output source
1 parent 6d74d8c commit 87af18f

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ Copy the output image to your clipboard, so you can paste it anywhere.
165165

166166
```bash
167167
freeze main.go --output clipboard
168-
freeze main.go --output copy
169168
```
170169

171170
### Font

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ func main() {
396396
istty := isatty.IsTerminal(os.Stdout.Fd())
397397

398398
outputName := config.Output
399-
if config.Output == "clipboard" || config.Output == "copy" {
399+
if config.Output == "clipboard" {
400400
outputName = "clipboard.png"
401401
}
402402
switch {

png.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func libsvgConvert(doc *etree.Document, _, _ float64, output string) error {
4848
if err != nil {
4949
return err
5050
}
51-
err = copyToClipboard(png)
51+
return copyToClipboard(png)
5252
}
5353
return err //nolint: wrapcheck
5454
}
@@ -114,10 +114,7 @@ func resvgConvert(doc *etree.Document, w, h float64, output string) error {
114114
}
115115

116116
if output == "clipboard" {
117-
err = copyToClipboard(png)
118-
} else {
119-
err = os.WriteFile(output, png, 0o600)
117+
return copyToClipboard(png)
120118
}
121-
122-
return err //nolint: wrapcheck
119+
return os.WriteFile(output, png, 0o600)
123120
}

0 commit comments

Comments
 (0)