mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-02 23:08:07 +08:00
test the correct return value
`res=$?` erases `$?` (sets it to 0) fixes #5577 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
parent
d0d300c4ae
commit
67ea8dde0e
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user