Add -purge-from-repos="repo1,repo2,..." and -disable-count-tags options

This commit is contained in:
Roman Vynar
2024-02-22 18:15:18 +02:00
parent 8a48bd4e8b
commit f91c3b9aca
6 changed files with 57 additions and 21 deletions

View File

@@ -5,6 +5,7 @@ import (
"os"
"reflect"
"sort"
"strings"
"time"
"github.com/sirupsen/logrus"
@@ -58,3 +59,15 @@ func ItemInSlice(item string, slice []string) bool {
}
return false
}
// Sprit repo path by namespace and repo name
func SplitRepoPath(repoPath string) (string, string) {
namespace := "library"
repo := repoPath
if strings.Contains(repoPath, "/") {
f := strings.SplitN(repoPath, "/", 2)
namespace = f[0]
repo = f[1]
}
return namespace, repo
}