aboutsummaryrefslogtreecommitdiff
path: root/internal/github/filesystem.go
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-10-02 16:49:36 -0500
committerSlack Coder <slackcoder@server.ky>2024-10-02 17:01:48 -0500
commit2597c03d1555e00dec59830b7de75e7090208e05 (patch)
tree5642202b4621ea722ee85b322d79bbad17894026 /internal/github/filesystem.go
parentb81d017b42cc814e603de2b49e4b78362ae73f2a (diff)
downloadmirror-2597c03d1555e00dec59830b7de75e7090208e05.tar.xz
config: Use TOML
TOML is simple for users, and it is used in notably projects like rustlang. It also provides comments!
Diffstat (limited to 'internal/github/filesystem.go')
-rw-r--r--internal/github/filesystem.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/github/filesystem.go b/internal/github/filesystem.go
index 3f069b4..219ec5d 100644
--- a/internal/github/filesystem.go
+++ b/internal/github/filesystem.go
@@ -2,13 +2,14 @@ package github
import (
"fmt"
- "net/url"
"os"
"path"
"strings"
+
+ "git.server.ky/slackcoder/mirror/internal"
)
-func listReleasesByTagName(dst *url.URL) ([]string, error) {
+func listReleasesByTagName(dst *internal.URL) ([]string, error) {
entries, err := os.ReadDir(dst.Path)
if err != nil {
return nil, err
@@ -23,7 +24,7 @@ func listReleasesByTagName(dst *url.URL) ([]string, error) {
}
// The path which project release assets are saved.
-func localReleaseFilePath(dst *url.URL, tagName string) string {
+func localReleaseFilePath(dst *internal.URL, tagName string) string {
return path.Join(dst.Path, tagName)
}
@@ -46,7 +47,7 @@ func releaseSourceFileName(project string, tagName string, ext string) string {
return fmt.Sprintf("%s-%s.%s", project, releaseName(tagName), ext)
}
-func removeRelease(dst *url.URL, tagName string) error {
+func removeRelease(dst *internal.URL, tagName string) error {
fp := localReleaseFilePath(dst, tagName)
return os.RemoveAll(fp)
}