aboutsummaryrefslogtreecommitdiffsponsor
path: root/internal/github/filesystem.go
diff options
context:
space:
mode:
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)
}