FIX: we cannot prompt for user input if we have no tty
authorMichael Brown <supermathie@gmail.com>
Mon, 10 Jun 2019 17:24:22 +0000 (13:24 -0400)
committerMichael Brown <supermathie@gmail.com>
Mon, 10 Jun 2019 17:24:22 +0000 (13:24 -0400)
launcher

index 8ef915c95d2d8fe49045564249f48c02da74d533..6a71521ac897ead79fd9039df7c5fce2c7036cc8 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -223,12 +223,14 @@ check_prereqs() {
     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
-    read -p "Would you like to attempt to recover space by cleaning docker images and containers in the system?(y/N)" -n 1 -r
-    echo
-    if [[ $REPLY =~ ^[Yy]$ ]]
-    then
-      $docker_path system prune -af
-      echo "If the cleanup was successful, you may try again now"
+    if tty >/dev/null; then
+      read -p "Would you like to attempt to recover space by cleaning docker images and containers in the system?(y/N)" -n 1 -r
+      echo
+      if [[ $REPLY =~ ^[Yy]$ ]]
+      then
+        $docker_path system prune -af
+        echo "If the cleanup was successful, you may try again now"
+      fi
     fi
     exit 1
   fi