From 623f10733874815348f603b3968082f169768487 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 10 Jun 2019 13:24:22 -0400 Subject: [PATCH] FIX: we cannot prompt for user input if we have no tty --- launcher | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/launcher b/launcher index 8ef915c..6a71521 100755 --- 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 -- 2.25.1