Skip to content

Commit

Permalink
Merge pull request #1 from spiegel-im-spiegel/debug
Browse files Browse the repository at this point in the history
Copy link to clipboard
  • Loading branch information
spiegel-im-spiegel authored Nov 8, 2017
2 parents 3827730 + 640496d commit 5eb36b6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
8 changes: 7 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ ignored = [
[[constraint]]
name = "golang.org/x/crypto"
branch = "master"

[[constraint]]
name = "github.com/atotto/clipboard"
branch = "master"
2 changes: 1 addition & 1 deletion cli/mklink/interactive/interractive.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const (
header = "Press Ctrl+C to stop"
prompt = "mklimk> "
prompt = "mklink> "
)

//Context class is context for making link
Expand Down
14 changes: 8 additions & 6 deletions cli/mklink/makelink/makelink.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package makelink

import (
"bytes"
"fmt"
"io"

"github.com/atotto/clipboard"
"github.com/spiegel-im-spiegel/mklink"
)

Expand All @@ -27,12 +29,12 @@ func (c *Context) MakeLink(url string) error {
}

r := lnk.Encode(c.linkStyle)
if c.log == nil {
io.Copy(c.writer, r)
} else {
buf := new(bytes.Buffer)
io.Copy(c.writer, io.TeeReader(r, buf))
io.Copy(c.log, buf)
buf := new(bytes.Buffer)
io.Copy(c.writer, io.TeeReader(r, buf))
strLink := buf.String()
clipboard.WriteAll(strLink)
if c.log != nil {
fmt.Fprint(c.log, strLink)
}
return nil
}
Binary file modified dependency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5eb36b6

Please sign in to comment.