jjr-joplin/cleanup.sh

39 lines
611 B
Bash
Raw Normal View History

2019-05-13 17:00:41 +02:00
#!/bin/sh
# Prompts for confirmation, returns 1 if Yes
#
# Usage: getConfirmation "Question message"
# You can get anwser value on retcode
# if [[ $? == "1"]]; then
# echo "You choose yes"
# fi
function getConfirmation {
value=0
while true; do
read -p "${1} [Y/n]" yn
case $yn in
[Yy]* ) return 0 ;;
[Nn]* ) return 1 ;;
* ) return 0 ;;
esac
done
}
echo "This script will cleanup all workfiles"
getConfirmation "Do you want to proccess"
if [[ $1 == "0" ]]; then
echo "Aborting"
exit 1
fi
rm -r src/
rm -r pkg/
rm v*.zip
2019-05-27 12:21:21 +02:00
rm v*.zip.part
2020-04-01 00:13:22 +02:00
rm *tar.gz
2019-05-13 17:00:41 +02:00
rm *tar.xz
exit 0