Add high-level function for calling the daemon if it is open

This commit is contained in:
RandyTheSilly committed 2025-05-04 19:38:45 -04:00
1 parent 0479447f14
commit 9314852f06
6 files changed
+36 -39

No files matched your search

+10
View File
@@ -5,3 +5,13 @@ import (
)
var binPath, _ = os.Executable() // store binary path
// daemonIsOpen checks if the socket/named pipe for the rcw
// daemon exists and returns a boolean indicator.
func daemonIsOpen() bool {
fileInfo, err := os.Stat(socketPath)
if err != nil {
return false
}
return !fileInfo.IsDir()
}