admin: Can delete a repository directory if needed
This commit is contained in:
parent
7692f92aa4
commit
c1924c0e92
5 changed files with 48 additions and 4 deletions
|
@ -57,6 +57,10 @@ func (i GitImporter) Kind() string {
|
|||
return "git originated from " + i.Remote + " on " + i.li.Kind()
|
||||
}
|
||||
|
||||
func (i GitImporter) DeleteDir(filename string) error {
|
||||
return i.li.DeleteDir(filename)
|
||||
}
|
||||
|
||||
func getForgeBaseLink(remote string) (u *url.URL, err error) {
|
||||
res := gitRemoteRe.FindStringSubmatch(remote)
|
||||
u, err = url.Parse(res[2])
|
||||
|
|
|
@ -113,3 +113,11 @@ func (i LocalImporter) ListDir(filename string) ([]string, error) {
|
|||
func (i LocalImporter) Stat(filename string) (os.FileInfo, error) {
|
||||
return os.Stat(path.Join(i.Base, filename))
|
||||
}
|
||||
|
||||
type DeletableImporter interface {
|
||||
DeleteDir(filename string) error
|
||||
}
|
||||
|
||||
func (i LocalImporter) DeleteDir(filename string) error {
|
||||
return os.RemoveAll(path.Join(i.Base, filename))
|
||||
}
|
||||
|
|
Reference in a new issue