aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-03 16:32:45 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-03 16:47:01 +0800
commit565536e67385e7337e1a7d67c80499216d645882 (patch)
treeac3e714b70d1d2191668c91032f983b562f50254 /main.go
parentHTML: Fix authorship fields (diff)
downloadforge-565536e67385e7337e1a7d67c80499216d645882.tar.gz
forge-565536e67385e7337e1a7d67c80499216d645882.tar.zst
forge-565536e67385e7337e1a7d67c80499216d645882.zip
Automatically deploy and run git2d
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 12 insertions, 0 deletions
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
{