Skip exporting empty commands for #279 (#281)

This commit is contained in:
David Dworken 2025-01-13 14:55:32 -07:00 committed by GitHub
parent 74056c7262
commit 4c696d9788
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,6 +48,10 @@ func exportToJson(ctx context.Context, w io.Writer) error {
break
}
for _, entry := range entries {
if entry.Command == "" {
// Skip empty commands, see https://github.com/ddworken/hishtory/issues/279
continue
}
m, err := structToMap(*entry)
if err != nil {
return err