mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 17:35:16 +00:00
improv: prompt user when Docker daemon not running (#155)
Signed-off-by: kwakubiney <kebiney@hotmail.com>
This commit is contained in:
@@ -108,9 +108,25 @@ clean_dev_docker() {
|
|||||||
if run_with_timeout 3 docker info > /dev/null 2>&1; then
|
if run_with_timeout 3 docker info > /dev/null 2>&1; then
|
||||||
clean_tool_cache "Docker build cache" docker builder prune -af
|
clean_tool_cache "Docker build cache" docker builder prune -af
|
||||||
else
|
else
|
||||||
note_activity
|
if [[ -t 0 ]]; then
|
||||||
|
echo -ne " ${YELLOW}${ICON_WARNING}${NC} Docker not running. ${GRAY}Enter${NC} retry / ${GRAY}any key${NC} skip: "
|
||||||
|
local key
|
||||||
|
IFS= read -r -s -n1 key || key=""
|
||||||
|
printf "\r\033[2K"
|
||||||
|
if [[ -z "$key" || "$key" == $'\n' || "$key" == $'\r' ]]; then
|
||||||
|
if run_with_timeout 3 docker info > /dev/null 2>&1; then
|
||||||
|
clean_tool_cache "Docker build cache" docker builder prune -af
|
||||||
|
else
|
||||||
|
echo -e " ${GRAY}${ICON_SUCCESS}${NC} Docker build cache (still not running)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e " ${GRAY}${ICON_SUCCESS}${NC} Docker build cache (skipped)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
echo -e " ${GRAY}${ICON_SUCCESS}${NC} Docker build cache (daemon not running)"
|
echo -e " ${GRAY}${ICON_SUCCESS}${NC} Docker build cache (daemon not running)"
|
||||||
fi
|
fi
|
||||||
|
note_activity
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
note_activity
|
note_activity
|
||||||
echo -e " ${YELLOW}→${NC} Docker build cache (would clean)"
|
echo -e " ${YELLOW}→${NC} Docker build cache (would clean)"
|
||||||
|
|||||||
Reference in New Issue
Block a user