1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-24 22:38:27 +08:00

Merge pull request #5580 from ipfs/fix/5577

test the correct return value
This commit is contained in:
Steven Allen
2018-10-12 15:18:09 +01:00
committed by GitHub

View File

@ -405,13 +405,13 @@ directory_size() {
find "$1" -type f | ( while read fname; do
fsize=$(file_size "$fname")
res=$?
if ! test $? -eq 0; then
if ! test $res -eq 0; then
echo "failed to get filesize" >&2
return $res
fi
total=$(expr "$total" + "$fsize")
res=$?
if ! test $? -eq 0; then
if ! test $res -eq 0; then
echo "filesize not a number: $fsize" >&2
return $res
fi