sync: Expose sync.Exists function

This commit is contained in:
nemunaire 2023-05-03 10:54:02 +02:00
commit c5a059bd3b
8 changed files with 31 additions and 31 deletions

View file

@ -47,7 +47,7 @@ func (i LocalImporter) Sync() error {
return nil
}
func (i LocalImporter) exists(filename string) bool {
func (i LocalImporter) Exists(filename string) bool {
_, err := os.Stat(i.toURL(filename))
return !os.IsNotExist(err)
}
@ -68,7 +68,7 @@ func (i LocalImporter) importFile(URI string, next func(string, string) (interfa
return nil, err
}
if i.exists(URI) {
if i.Exists(URI) {
os.Symlink(i.toURL(URI), dest)
return next(dest, URI)
} else {