mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-27 20:36:29 -04:00
Drop Termux support
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build (!android && !ios) || termux
|
||||
//go:build !android && !ios
|
||||
|
||||
package clip
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build (!android && !ios) || termux
|
||||
//go:build !android && !ios
|
||||
|
||||
package clip
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
//go:build android && termux
|
||||
|
||||
package clip
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os/exec"
|
||||
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
)
|
||||
|
||||
// CopyBytes copies a byte slice to the clipboard.
|
||||
func CopyBytes(clearClipboardAutomatically bool, copySubject []byte) error {
|
||||
cmd := exec.Command("termux-clipboard-set")
|
||||
_ = back.WriteToStdinAndZeroizeInput(cmd, copySubject)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return errors.New("unable to copy to clipboard: " + err.Error())
|
||||
}
|
||||
if clearClipboardAutomatically {
|
||||
LaunchClearProcess(copySubject)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// getClipCommands returns the commands for pasting and clearing the clipboard contents.
|
||||
func getClipCommands() (*exec.Cmd, *exec.Cmd, error) {
|
||||
cmdClear := exec.Command("termux-clipboard-set")
|
||||
_ = back.WriteToStdinAndZeroizeInput(cmdClear, nil)
|
||||
return exec.Command("termux-clipboard-get"), cmdClear, nil
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build !windows && !darwin && !android && !ios && !termux && !wsl
|
||||
//go:build !windows && !darwin && !android && !ios && !wsl
|
||||
|
||||
package clip
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !ios && (!android || termux) && !interactive
|
||||
//go:build !ios && !android && !interactive
|
||||
|
||||
package clip
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !ios && (!android || termux) && interactive
|
||||
//go:build !ios && !android && interactive
|
||||
|
||||
package clip
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build (!android && !ios) || termux
|
||||
//go:build !android && !ios
|
||||
|
||||
package clip
|
||||
|
||||
|
||||
Reference in New Issue
Block a user