1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 02:30:39 +08:00

test: fix sharness disk_usage util

on bsd based systems du returns block count not bytes

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera
2017-03-07 23:50:19 +01:00
parent afc0e77320
commit e2ececa4fa

View File

@ -343,15 +343,18 @@ disk_usage() {
case $(uname -s) in
Linux)
DU="du -sb"
M=1
;;
FreeBSD)
DU="du -s -A -B 1"
M=512
;;
Darwin | DragonFly | *)
DU="du -s"
M=512
;;
esac
$DU "$1" | awk "{print \$1}"
expr $($DU "$1" | awk "{print \$1}") "*" "$M"
}
# output a file's permission in human readable format