aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-06-11 22:25:45 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-06-11 22:25:45 +0200
commit89705dd61f418df561ebbe7cf645ba82a61e47e7 (patch)
treec9e16bd0c65956b298866f3ff8461fe998a5d8ab
parent98b4a72f1776d0343c0649920f031723e5ca0e47 (diff)
downloadcerrado-0.0.3.tar.gz
cerrado-0.0.3.tar.bz2
cerrado-0.0.3.zip
fix: Make use of the descriptionv0.0.3
-rw-r--r--README.md2
-rw-r--r--pkg/service/git.go15
-rw-r--r--pkg/worker/http.go2
3 files changed, 4 insertions, 15 deletions
diff --git a/README.md b/README.md
index 5a723e5..fd92d5c 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
# Cerrado
-Read only single user mail based forge for git.
+Self single user mail based forge for git.
diff --git a/pkg/service/git.go b/pkg/service/git.go
index 7418d97..0907924 100644
--- a/pkg/service/git.go
+++ b/pkg/service/git.go
@@ -3,12 +3,9 @@ package service
import (
"errors"
"log/slog"
- "os"
- "path"
"git.gabrielgio.me/cerrado/pkg/config"
"git.gabrielgio.me/cerrado/pkg/git"
- "git.gabrielgio.me/cerrado/pkg/u"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
)
@@ -66,19 +63,9 @@ func (g *GitService) ListRepositories() ([]*Repository, error) {
continue
}
- d := path.Join(r.Path, "description")
- description := ""
- if u.FileExist(d) {
- if b, err := os.ReadFile(d); err == nil {
- description = string(b)
- } else {
- slog.Error("Error loading description file", "err", err)
- }
- }
-
repos = append(repos, &Repository{
Name: r.Name,
- Description: description,
+ Description: r.Description,
LastCommitDate: obj.Author.When.Format(timeFormat),
Ref: head.Name().Short(),
})
diff --git a/pkg/worker/http.go b/pkg/worker/http.go
index c4f9950..1559ba2 100644
--- a/pkg/worker/http.go
+++ b/pkg/worker/http.go
@@ -3,6 +3,7 @@ package worker
import (
"context"
"errors"
+ "log/slog"
"net"
"net/http"
"net/url"
@@ -36,6 +37,7 @@ func (s *ServerTask) Start(ctx context.Context) error {
}
go func() {
+ slog.Info("Serving", "addr", listen.Addr().String(), "network", listen.Addr().Network())
done <- server.Serve(listen)
}()