From 9c7056ed8b0ef9370c1b0269ee2725b048407bd4 Mon Sep 17 00:00:00 2001 From: Shalmon Anandas <67845465+ShalmonAnandas@users.noreply.github.com> Date: Thu, 19 Jan 2023 09:36:20 +0530 Subject: [PATCH] feat: windows clipboard(#6) --- .gitignore | 1 + utils.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index d0f0765..53767ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ gtt +*.exe \ No newline at end of file diff --git a/utils.go b/utils.go index 7a35826..fcce677 100644 --- a/utils.go +++ b/utils.go @@ -29,5 +29,9 @@ func CopyToClipboard(text string) { exec.Command("sh", "-c", fmt.Sprintf("echo -n '%s' | pbcopy", text)). Start() + case "windows": + exec.Command("cmd", "/c", + fmt.Sprintf("echo %s | clip", text)). + Start() } }