diff options
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r-- | pkg/commands/os.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index 517372662..98317312d 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -454,3 +454,14 @@ func RunLineOutputCmd(cmd *exec.Cmd, onLine func(line string) (bool, error)) err cmd.Wait() return nil } + +func (c *OSCommand) CopyToClipboard(str string) error { + commandTemplate := c.Config.GetUserConfig().GetString("os.copyToClipboardCommand") + templateValues := map[string]string{ + "str": c.Quote(str), + } + + command := utils.ResolvePlaceholderString(commandTemplate, templateValues) + + return c.RunCommand(command) +} |