Skip to content

Commit

Permalink
copy to clipboard after upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jozsefsallai committed Feb 12, 2020
1 parent 449adca commit 43ec936
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"

"github.com/atotto/clipboard"
"github.com/jozsefsallai/fastbin-cli/config"
"github.com/jozsefsallai/fastbin-cli/utils"
"github.com/urfave/cli"
Expand All @@ -18,6 +19,8 @@ func printUrls(key string) {
documentURL := conf.Server + "/" + key
rawURL := conf.Server + "/raw/" + key

clipboard.WriteAll(documentURL)

fmt.Println("Snippet uploaded successfully!")
fmt.Println("URL:", documentURL)
fmt.Println("Raw:", rawURL)
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/jozsefsallai/fastbin-cli
go 1.13

require (
github.com/atotto/clipboard v0.1.2
github.com/mitchellh/go-homedir v1.1.0
github.com/urfave/cli v1.22.0
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/atotto/clipboard v0.1.2 h1:YZCtFu5Ie8qX2VmVTBnrqLSiU9XOWwqNRmdT3gIQzbY=
github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
Expand Down

0 comments on commit 43ec936

Please sign in to comment.