termux-tools: termux-setup-storage: more detailed prompt about wiping

This commit is contained in:
Leonid Pliushch 2021-10-13 14:02:25 +03:00
parent 8020c43f38
commit 5a05be5d99
No known key found for this signature in database
GPG Key ID: 45F2964132545795
1 changed files with 10 additions and 5 deletions

View File

@ -8,13 +8,18 @@ if [ "$#" != "0" ]; then
fi fi
if [ -d "@TERMUX_HOME@/storage" ]; then if [ -d "@TERMUX_HOME@/storage" ]; then
echo cat <<- EOF
echo "Directory '~/storage' is going to be wiped. No storage contents will be touched."
echo It appears that directory '~/storage' already exists.
read -re -p "Do you want to continue ? (y/n) " CHOICE This script is going to rebuild its structure from
scratch, wiping all dangling files. The actual storage
content IS NOT going to be deleted.
EOF
read -re -p "Do you want to continue? (y/n) " CHOICE
if ! [[ "${CHOICE}" =~ (Y|y) ]]; then if ! [[ "${CHOICE}" =~ (Y|y) ]]; then
echo "Leaving intact the contents of '~/storage' directory." echo "Aborting configuration and leaving directory '~/storage' intact."
exit 1 exit 1
fi fi
fi fi