Skip to content

Commit

Permalink
add ino, hlnkc to json
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwren authored and dundee committed Oct 26, 2021
1 parent a1addc8 commit 2042af5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/analyze/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func (f *File) EncodeJSON(writer io.Writer, topLevel bool) error {
if f.Flag == '@' {
buff = append(buff, []byte(`,"notreg":true`)...)
}
if f.Flag == 'H' {
buff = append(buff, []byte(`,"ino":`+strconv.FormatUint(f.Mli, 10)+`,"hlnkc":true`)...)
}

buff = append(buff, '}')

Expand Down
6 changes: 6 additions & 0 deletions report/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ func processDir(items []interface{}) (*analyze.Dir, error) {
} else {
file.Flag = ' '
}
if mli, ok := item["ino"].(float64); ok {
file.Mli = uint64(mli)
}
if _, ok := item["hlnkc"].(bool); ok {
file.Flag = 'H'
}

file.Parent = dir

Expand Down

0 comments on commit 2042af5

Please sign in to comment.