1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 09:35:00 +09:00

Merge pull request #1451 from anyproto/go-2746-export-structure

GO-2746: add export structure
This commit is contained in:
Anastasia Shemyakinskaya 2024-08-13 15:02:21 +02:00 committed by GitHub
commit 5acb29e2b4
Signed by: github
GPG key ID: B5690EEEBB952194
4 changed files with 122 additions and 13 deletions

View file

@ -84,8 +84,18 @@ func TestExportFiles(t *testing.T) {
var foundPbFiles int
for _, entry := range entries {
if filepath.Ext(entry.Name()) == ".pb" {
foundPbFiles++
if entry.IsDir() {
files, err := os.ReadDir(filepath.Join(exportPath, entry.Name()))
require.NoError(t, err)
for _, file := range files {
if filepath.Ext(file.Name()) == ".pb" {
foundPbFiles++
}
}
} else {
if filepath.Ext(entry.Name()) == ".pb" {
foundPbFiles++
}
}
}
// 4 objects total: Page object + Page type + File object