mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 18:13:54 +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:
@ -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
|
||||
|
Reference in New Issue
Block a user