From 4eb7bddcff296320bf5813585f20420d77a28d98 Mon Sep 17 00:00:00 2001 From: z4yx Date: Thu, 30 Apr 2020 09:38:46 +0800 Subject: [PATCH] fix problem caused by empty repo size file --- helpers/size-sum.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helpers/size-sum.sh b/helpers/size-sum.sh index 1fef087..59285a4 100755 --- a/helpers/size-sum.sh +++ b/helpers/size-sum.sh @@ -1,5 +1,7 @@ #!/bin/bash # requires: coreutils +[[ -f "$1" ]] || exit sz=$(cat $1) -sz=$(($sz)) +sz=$((0$sz)) echo "size-sum:" $(numfmt --to=iec $sz) +[[ "$2" == "--rm" ]] && rm "$1" \ No newline at end of file