forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

knotserver: setup hooks for forks too

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 1c8c3ea1 33b204aa

verified
Changed files
+13 -9
knotserver
+13 -9
knotserver/routes.go
···
return
}
-
err = hook.SetupRepo(hook.Config(
-
hook.WithScanPath(h.c.Repo.ScanPath),
-
hook.WithInternalApi(h.c.Server.InternalListenAddr),
-
),
+
hook.SetupRepo(
+
hook.Config(
+
hook.WithScanPath(h.c.Repo.ScanPath),
+
hook.WithInternalApi(h.c.Server.InternalListenAddr),
+
),
repoPath,
)
-
if err != nil {
-
l.Error("setting up hooks", "error", err.Error())
-
writeError(w, err.Error(), http.StatusInternalServerError)
-
return
-
}
w.WriteHeader(http.StatusNoContent)
}
···
writeError(w, err.Error(), http.StatusInternalServerError)
return
}
+
+
hook.SetupRepo(
+
hook.Config(
+
hook.WithScanPath(h.c.Repo.ScanPath),
+
hook.WithInternalApi(h.c.Server.InternalListenAddr),
+
),
+
repoPath,
+
)
w.WriteHeader(http.StatusNoContent)
}