Return error form Repo.Exists
This commit is contained in:
+6
-2
@@ -58,9 +58,13 @@ func NewFS(path string) (*FsRepo, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (fsr *FsRepo) Exists() bool {
|
||||
func (fsr *FsRepo) Exists() (bool, error) {
|
||||
_, err := os.Stat(fsr.path)
|
||||
return err == nil
|
||||
notexist := os.IsNotExist(err)
|
||||
if notexist {
|
||||
err = nil
|
||||
}
|
||||
return !notexist, err
|
||||
}
|
||||
|
||||
func (fsr *FsRepo) Init() error {
|
||||
|
||||
Reference in New Issue
Block a user