Merge pull request #448 from guoyangzhen/fix/startup-script-integer-comparison
fix: handle empty dir_size_bytes and remove deprecated docker-compose version
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
redis:
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ max_size_bytes=$((2 * 1024 * 1024 * 1024 * 10))
|
||||
|
||||
echo "Mounting $WORK_DIR ($dir_size_bytes bytes) to docker."
|
||||
|
||||
if [ "$dir_size_bytes" -gt "$max_size_bytes" ]; then
|
||||
if [ -n "$dir_size_bytes" ] && [ "$dir_size_bytes" -gt "$max_size_bytes" ]; then
|
||||
echo "Error: WORK_DIR ($WORK_DIR) contains more than 20GB of data ($(du -sh "$WORK_DIR" 2>/dev/null | awk '{print $1}'))."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user