From 2597c03d1555e00dec59830b7de75e7090208e05 Mon Sep 17 00:00:00 2001 From: Slack Coder Date: Wed, 2 Oct 2024 16:49:36 -0500 Subject: config: Use TOML TOML is simple for users, and it is used in notably projects like rustlang. It also provides comments! --- internal/service/git.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/service/git.go') diff --git a/internal/service/git.go b/internal/service/git.go index ad3a653..b61e332 100644 --- a/internal/service/git.go +++ b/internal/service/git.go @@ -3,11 +3,12 @@ package service import ( "errors" "fmt" - "net/url" "os" "os/exec" "path" "strings" + + "git.server.ky/slackcoder/mirror/internal" ) const gitDescriptionFile = "description" @@ -44,7 +45,7 @@ func setDescription(repo string, desc string) error { } // Set the remote origin's URL for the projects repository. -func setRemoteOrigin(repo string, origin *url.URL) error { +func setRemoteOrigin(repo string, origin *internal.URL) error { cmd := exec.Command("git", "remote", "get-url", "origin") cmd.Dir = repo buf, err := cmd.Output() @@ -87,7 +88,7 @@ func getRemoteHeadReference(repo string) (string, error) { return "", errors.New("not found") } -func MirrorGit(dst *url.URL, src *url.URL, description string) error { +func MirrorGit(dst *internal.URL, src *internal.URL, description string) error { if dst.Scheme != "" && dst.Scheme != "file://" { return fmt.Errorf("'%s' scheme not supported", dst.Scheme) } -- cgit v1.2.3