Skip to content

Commit

Permalink
Merge fbb45c0 into 50f7517
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Aug 29, 2018
2 parents 50f7517 + fbb45c0 commit fcace07
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions util/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,20 @@ func parseDfLines(out string) []*DfStat {
continue
}

if runtime.GOOS == "darwin" && strings.HasPrefix(dfstat.Mounted, "/Volumes/") {
continue
if runtime.GOOS == "darwin" {
if strings.HasPrefix(dfstat.Mounted, "/Volumes/") {
continue
}
// Skip APFS vm partition, add its usage to the root filesystem.
if strings.HasPrefix(dfstat.Mounted, "/private/var/vm") {
for _, fs := range filesystems {
if fs.Mounted == "/" {
fs.Used += dfstat.Used
break
}
}
continue
}
}

filesystems = append(filesystems, dfstat)
Expand Down

0 comments on commit fcace07

Please sign in to comment.