mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-06 20:35:11 +01:00
Final, nicest method
This commit is contained in:
@@ -1,21 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Dry run, stating what files would be removed
|
||||||
git clean -d -x -n
|
git clean -d -x -n
|
||||||
|
|
||||||
echo "Continue the real cleanup of the tree? [y/N]"
|
read -r -p "Continue the real cleanup of the tree? [y/N] " -n 1 response
|
||||||
|
response=${response,,} # tolower
|
||||||
read -n 1 "Continue the real cleanup of the tree (y/n)?" choice
|
if [[ $response =~ ^(yes|y| ) ]]; then
|
||||||
case "$choice" in
|
echo
|
||||||
y|Y ) echo "yes";;
|
|
||||||
n|N ) echo "no";;
|
|
||||||
* ) echo "invalid";;
|
|
||||||
esac
|
|
||||||
|
|
||||||
read -n 1 answer
|
|
||||||
|
|
||||||
if (( ${#answer} && (( "$answer" == "Y" || "$answer" == "y" )) )); then
|
|
||||||
echo "Cleaning up"
|
echo "Cleaning up"
|
||||||
#git clean -d -x -f
|
git clean -d -x -f
|
||||||
else
|
else
|
||||||
|
echo
|
||||||
echo "Aborted"
|
echo "Aborted"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user