mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-09-01 22:57:25 -04:00
Fix build failures on several platforms
This commit is contained in:
+2
-2
@@ -11,7 +11,7 @@ import (
|
|||||||
// copyString copies a string to the clipboard.
|
// copyString copies a string to the clipboard.
|
||||||
func copyString(continuous bool, copySubject string) {
|
func copyString(continuous bool, copySubject string) {
|
||||||
cmd := exec.Command("pbcopy")
|
cmd := exec.Command("pbcopy")
|
||||||
writeToStdin(cmd, copySubject)
|
WriteToStdin(cmd, copySubject)
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(AnsiError+"Failed to copy to clipboard:", err.Error()+AnsiReset)
|
fmt.Println(AnsiError+"Failed to copy to clipboard:", err.Error()+AnsiReset)
|
||||||
@@ -26,6 +26,6 @@ func copyString(continuous bool, copySubject string) {
|
|||||||
// getClipCommands returns the commands for pasting and clearing the clipboard contents.
|
// getClipCommands returns the commands for pasting and clearing the clipboard contents.
|
||||||
func getClipCommands() (*exec.Cmd, *exec.Cmd) {
|
func getClipCommands() (*exec.Cmd, *exec.Cmd) {
|
||||||
cmdClear := exec.Command("pbcopy")
|
cmdClear := exec.Command("pbcopy")
|
||||||
writeToStdin(cmdClear, "")
|
WriteToStdin(cmdClear, "")
|
||||||
return exec.Command("pbpaste"), cmdClear
|
return exec.Command("pbpaste"), cmdClear
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ import (
|
|||||||
// copyString copies a string to the clipboard.
|
// copyString copies a string to the clipboard.
|
||||||
func copyString(continuous bool, copySubject string) {
|
func copyString(continuous bool, copySubject string) {
|
||||||
cmd := exec.Command("termux-clipboard-set")
|
cmd := exec.Command("termux-clipboard-set")
|
||||||
writeToStdin(cmd, copySubject)
|
WriteToStdin(cmd, copySubject)
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(AnsiError+"Failed to copy to clipboard:", err.Error()+AnsiReset)
|
fmt.Println(AnsiError+"Failed to copy to clipboard:", err.Error()+AnsiReset)
|
||||||
@@ -26,6 +26,6 @@ func copyString(continuous bool, copySubject string) {
|
|||||||
// getClipCommands returns the commands for pasting and clearing the clipboard contents.
|
// getClipCommands returns the commands for pasting and clearing the clipboard contents.
|
||||||
func getClipCommands() (*exec.Cmd, *exec.Cmd) {
|
func getClipCommands() (*exec.Cmd, *exec.Cmd) {
|
||||||
cmdClear := exec.Command("termux-clipboard-set")
|
cmdClear := exec.Command("termux-clipboard-set")
|
||||||
writeToStdin(cmdClear, "")
|
WriteToStdin(cmdClear, "")
|
||||||
return exec.Command("termux-clipboard-get"), cmdClear
|
return exec.Command("termux-clipboard-get"), cmdClear
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
func LaunchClipClearProcess(copySubject string) {
|
func LaunchClipClearProcess(copySubject string) {
|
||||||
executableName := os.Args[0]
|
executableName := os.Args[0]
|
||||||
cmd := exec.Command(executableName, "clipclear")
|
cmd := exec.Command(executableName, "clipclear")
|
||||||
writeToStdin(cmd, copySubject)
|
WriteToStdin(cmd, copySubject)
|
||||||
err := cmd.Start()
|
err := cmd.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(AnsiError + "Failed to launch automated clipboard clearing process - Does this libmutton implementation support the \"clipclear\" argument?" + AnsiReset)
|
fmt.Println(AnsiError + "Failed to launch automated clipboard clearing process - Does this libmutton implementation support the \"clipclear\" argument?" + AnsiReset)
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ package core
|
|||||||
// For interactive GUI/TUI implementations, the clipboard clearing process is launched as a goroutine.
|
// For interactive GUI/TUI implementations, the clipboard clearing process is launched as a goroutine.
|
||||||
// copySubject can be omitted to clear the clipboard immediately and unconditionally.
|
// copySubject can be omitted to clear the clipboard immediately and unconditionally.
|
||||||
func LaunchClipClearProcess(copySubject string) {
|
func LaunchClipClearProcess(copySubject string) {
|
||||||
go ClipClearProcess(copySubject)
|
go clipClearProcess(copySubject)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user