···
···
Usage: "internal API endpoint",
Value: "http://localhost:5444",
49
+
Usage: "path to message of the day file",
50
+
Value: "/home/git/motd",
···
gitDir := cmd.String("git-dir")
logPath := cmd.String("log-path")
endpoint := cmd.String("internal-api")
63
+
motdFile := cmd.String("motd-file")
logFile, err := os.OpenFile(logPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
···
160
+
if motdRaw, err := os.ReadFile(motdFile); err != nil {
161
+
if !errors.Is(err, os.ErrNotExist) {
162
+
l.Error("failed to read motd file", "error", err)
164
+
motd = "Welcome to this knot!\n"
166
+
motd = string(motdRaw)
if gitCommand == "git-upload-pack" {
153
-
fmt.Fprintf(os.Stderr, "\x02%s\n", "Welcome to this knot!")
169
+
fmt.Fprintf(os.Stderr, "\x02%s", motd)
155
-
fmt.Fprintf(os.Stderr, "%s\n", "Welcome to this knot!")
171
+
fmt.Fprintf(os.Stderr, "%s", motd)
gitCmd := exec.Command(gitCommand, fullPath)