fix: filter result if exported data is empty

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2022-06-05 15:27:14 +08:00
parent d1ae09d9e4
commit 7b8e2a3fd2
9 changed files with 85 additions and 11 deletions
+6
View File
@@ -24,6 +24,8 @@ type Source interface {
Parse(masterKey []byte) error
Name() string
Length() int
}
func New(sources []item.Item) *Data {
@@ -47,6 +49,10 @@ func (d *Data) Output(dir, browserName, flag string) {
output := NewOutPutter(flag)
for _, source := range d.sources {
if source.Length() == 0 {
// if the length of the export data is 0, then it is not necessary to output
continue
}
filename := fileutil.Filename(browserName, source.Name(), output.Ext())
f, err := output.CreateFile(dir, filename)