From 565536e67385e7337e1a7d67c80499216d645882 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 3 Apr 2025 16:32:45 +0800 Subject: Automatically deploy and run git2d --- main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 75e187f..84458cb 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "flag" "net" "net/http" + "os/exec" "syscall" "time" @@ -31,6 +32,17 @@ func main() { if err := loadTemplates(); err != nil { clog.Fatal(1, "Loading templates: "+err.Error()) } + if err := deployGit2D(); err != nil { + clog.Fatal(1, "Deploying git2d: "+err.Error()) + } + + // Launch Git2D + go func() { + cmd := exec.Command(config.Git.DaemonPath, config.Git.Socket) //#nosec G204 + if err := cmd.Run(); err != nil { + panic(err) + } + }() // UNIX socket listener for hooks { -- cgit v1.2.3