From c099b69d859712f00eb8c05f8a0fbd18e61e6ff3 Mon Sep 17 00:00:00 2001 From: AngeD Date: Mon, 22 Aug 2022 17:23:17 +0200 Subject: [PATCH] feat: remove too much verbose --- bin/dkpurge | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/bin/dkpurge b/bin/dkpurge index 15008b3..55d5fae 100755 --- a/bin/dkpurge +++ b/bin/dkpurge @@ -1,10 +1,6 @@ #!/bin/bash NORMAL='\e[0m' -BOLD='\e[1m' -RED='\e[31m' - -ECHO='echo -e' PS="$(docker ps -aq 2> /dev/null)" @@ -18,10 +14,9 @@ IMG="$(docker images -q 2> /dev/null)" if [ -n "$PS" ]; then - $ECHO "${BOLD}${RED}CONTAINERS${NORMAL}" docker ps -a - $ECHO -n "Prune Containers? [Y/n/a] " + echo -n "Prune Containers? [Y/n/a] " read -r ANS case "${ANS,,}" in 'y'|'yes'|'') @@ -34,23 +29,23 @@ if [ -n "$PS" ]; then fi if [ -n "$VOL" ]; then - $ECHO "${BOLD}${RED}VOLUMES${NORMAL}" + echo docker volume ls - $ECHO -n "Prune Volumes? [Y/n] " + echo -n "Prune Volumes? [Ya/n] " read -r ANS case "${ANS,,}" in - 'y'|'yes'|'') + 'y'|'yes'|'a'|'all'|'') echo "$VOL" | xargs docker volume rm -f 2> /dev/null ;; esac fi if [ -n "$IMG" ]; then - $ECHO "${BOLD}${RED}IMAGES${NORMAL}" + echo docker images - $ECHO -n "Prune Images? [Y/n/a] " + echo -n "Prune Images? [Y/n/a] " read -r ANS case "${ANS,,}" in 'y'|'yes'|'')