FIX: `/var/lib/docker` doesn't exist on macOS (#543)
authorJarek Radosz <jradosz@gmail.com>
Fri, 6 Aug 2021 01:17:01 +0000 (03:17 +0200)
committerGitHub <noreply@github.com>
Fri, 6 Aug 2021 01:17:01 +0000 (11:17 +1000)
Even though `docker info --format '{{.DockerRootDir}}'` returns that path.

launcher

index 91a39b91d1fdc89adc76d7c11cd39cccd9309ebb..8aaed23745becaaa9d10c7257c410ac9cdc6ca48 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -235,8 +235,7 @@ check_prereqs() {
   # 7. enough space for the bootstrap on docker folder
   folder=`$docker_path info --format '{{.DockerRootDir}}'`
   safe_folder=${folder:-/var/lib/docker}
-  test=$(($(stat -f --format="%a*%S" $safe_folder)/1024**3 < 5))
-  if [[ $test -ne 0 ]] ; then
+  if [[ -d $safe_folder && $(stat -f --format="%a*%S" $safe_folder)/1024**3 -lt 5 ]] ; then
     echo "You have less than 5GB of free space on the disk where $safe_folder is located. You will need more space to continue"
     df -h $safe_folder
     echo