Skip to content

Commit

Permalink
cmd/alloc: clipboard.Write of allocated URL should only run on daemon (
Browse files Browse the repository at this point in the history
  • Loading branch information
Summuss authored Nov 7, 2021
1 parent 3758276 commit 4de6d58
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/alloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import (
"log"

"changkun.de/x/midgard/api/daemon"
"changkun.de/x/midgard/internal/clipboard"
"changkun.de/x/midgard/internal/types"
"changkun.de/x/midgard/internal/types/proto"
"changkun.de/x/midgard/internal/utils"
"github.com/spf13/cobra"
"google.golang.org/grpc/status"
)
Expand Down Expand Up @@ -54,7 +51,8 @@ func allocate(dstpath, srcpath string) {
status.Convert(err).Message())
}
if out.URL != "" {
clipboard.Local.Write(types.MIMEPlainText, utils.StringToBytes(out.URL))
// Clipboard is updated on the daemon side, we don't have to
// write clipboard in the allocate command again, see PR#16.
fmt.Println(out.URL)
} else {
fmt.Printf("%v\n", out.Message)
Expand Down

0 comments on commit 4de6d58

Please sign in to comment.