sync: Expose sync.Exists function
This commit is contained in:
parent
5cf4565573
commit
c5a059bd3b
8 changed files with 31 additions and 31 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Reference in a new issue