fix: local relative path

This commit is contained in:
Noah Hsu
2022-06-27 20:37:05 +08:00
parent 7c0b86a9cd
commit 74973bc5b5
6 changed files with 25 additions and 5 deletions

View File

@ -34,6 +34,12 @@ func (d *Driver) Init(ctx context.Context, account model.Account) error {
err = errors.Errorf("root folder %s not exists", d.RootFolder)
d.SetStatus(err.Error())
} else {
if !filepath.IsAbs(d.RootFolder) {
d.RootFolder, err = filepath.Abs(d.RootFolder)
if err != nil {
return errors.Wrap(err, "error while get abs path")
}
}
d.SetStatus("OK")
}
operations.MustSaveDriverAccount(d)