Add support for the RCW daemon

This commit is contained in:
2025-05-04 19:48:20 -04:00
parent 826d94bc43
commit 21d60b8d0f
7 changed files with 48 additions and 14 deletions
+10
View File
@@ -1,6 +1,7 @@
package core
import (
"bufio"
"crypto/rand"
"fmt"
"io"
@@ -59,6 +60,15 @@ func writeToStdin(cmd *exec.Cmd, input string) {
}()
}
// readFromStdin is a utility function that reads a string from stdin.
func readFromStdin() string {
scanner := bufio.NewScanner(os.Stdin)
if scanner.Scan() {
return scanner.Text()
}
return ""
}
// CreateTempFile creates a temporary file and returns a pointer to it.
func CreateTempFile() *os.File {
tempFile, err := os.CreateTemp("", "*.markdown")