@@ -13,7 +13,7 @@ import (
1313)
1414
1515const (
16- sysTable = ".sys"
16+ sysDirectory = ".sys"
1717)
1818
1919type dbName interface {
@@ -49,9 +49,9 @@ type dbFoRemoveRecursive interface {
4949// MakeRecursive method equal bash command `mkdir -p ~/path/to/create`
5050// where `~` - is a root of database
5151func MakeRecursive (ctx context.Context , db dbForMakeRecursive , pathToCreate string ) error {
52- if strings .HasPrefix (pathToCreate , sysTable + "/" ) {
52+ if strings .HasPrefix (pathToCreate , sysDirectory + "/" ) {
5353 return xerrors .WithStackTrace (
54- fmt .Errorf ("making directory %q inside system path %q not supported" , pathToCreate , sysTable ),
54+ fmt .Errorf ("making directory %q inside system path %q not supported" , pathToCreate , sysDirectory ),
5555 )
5656 }
5757
@@ -90,7 +90,7 @@ func MakeRecursive(ctx context.Context, db dbForMakeRecursive, pathToCreate stri
9090// RemoveRecursive method equal bash command `rm -rf ~/path/to/remove`
9191// where `~` - is a root of database
9292func RemoveRecursive (ctx context.Context , db dbFoRemoveRecursive , pathToRemove string ) error {
93- fullSysTablePath := path .Join (db .Name (), sysTable )
93+ fullSysTablePath := path .Join (db .Name (), sysDirectory )
9494 var rmPath func (int , string ) error
9595 rmPath = func (i int , p string ) error {
9696 if exists , err := IsDirectoryExists (ctx , db .Scheme (), p ); err != nil {
@@ -108,7 +108,7 @@ func RemoveRecursive(ctx context.Context, db dbFoRemoveRecursive, pathToRemove s
108108 )
109109 }
110110
111- if entry .Type != scheme .EntryDirectory {
111+ if entry .Type != scheme .EntryDirectory && entry . Type != scheme . EntryDatabase {
112112 return nil
113113 }
114114
@@ -157,6 +157,10 @@ func RemoveRecursive(ctx context.Context, db dbFoRemoveRecursive, pathToRemove s
157157 }
158158 }
159159
160+ if entry .Type != scheme .EntryDirectory {
161+ return nil
162+ }
163+
160164 err = db .Scheme ().RemoveDirectory (ctx , p )
161165 if err != nil {
162166 return xerrors .WithStackTrace (
0 commit comments