MCPcopy Create free account
hub / github.com/JordanCoin/codemap / runDaemon

Function runDaemon

main.go:762–784  ·  view source on GitHub ↗
(root string)

Source from the content-addressed store, hash-verified

760}
761
762func runDaemon(root string) {
763 daemon, err := newWatchProcess(root, false)
764 if err != nil {
765 fmt.Fprintf(os.Stderr, "Error: %v\n", err)
766 os.Exit(1)
767 }
768
769 if err := daemon.Start(); err != nil {
770 fmt.Fprintf(os.Stderr, "Error starting watch: %v\n", err)
771 os.Exit(1)
772 }
773
774 // Write PID file
775 writeWatchPID(root)
776
777 // Wait for stop signal (SIGTERM or state file removal)
778 sigChan := make(chan os.Signal, 1)
779 notifySignals(sigChan, syscall.SIGTERM, syscall.SIGINT)
780 <-sigChan
781
782 daemon.Stop()
783 removeWatchPID(root)
784}
785
786// isGitHubURL checks if the input looks like a GitHub repo URL
787func isGitHubURL(s string) bool {

Callers 2

runWatchSubcommandFunction · 0.85

Calls 2

StartMethod · 0.65
StopMethod · 0.65

Tested by 1