── daemon state helpers ─────────────────────────────────────── gatewayStatePath returns ~/.chatcli/ , falling back to the temp dir.
(name string)
| 726 | |
| 727 | // gatewayStatePath returns ~/.chatcli/<name>, falling back to the temp dir. |
| 728 | func gatewayStatePath(name string) string { |
| 729 | home, err := os.UserHomeDir() |
| 730 | if err != nil { |
| 731 | return filepath.Join(os.TempDir(), name) |
| 732 | } |
| 733 | return filepath.Join(home, ".chatcli", name) |
| 734 | } |
| 735 | |
| 736 | // gatewayRunningPID returns the daemon PID if the pidfile points at a live |
| 737 | // process, clearing a stale pidfile otherwise. |
no outgoing calls