Skip to content

Commit

Permalink
issue #1 fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Thiago Lahr <[email protected]>
  • Loading branch information
tclahr committed Mar 27, 2020
1 parent fd6880c commit 0866a4d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/terminate.lib
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
################################################################################
terminate() {
logging I "\nCaught signal! Quitting...\n"
if [ -d "$DESTINATION_DIR/$TMP_DATA_DIR" ]; then
if ask_question_yn "Do you want to remove the temporary directory $DESTINATION_DIR/$TMP_DATA_DIR ?"; then
rm -rf "$DESTINATION_DIR/$TMP_DATA_DIR" > /dev/null
if [ ! -d "$DESTINATION_DIR/$TMP_DATA_DIR" ]; then
uprintf "Temporary directory removed successfully.\n"
else
uprintf "Cannot remove temporary directory.\n"
if [ ! -z "$DESTINATION_DIR" ] && [ ! -z "$TMP_DATA_DIR" ]; then
if [ -d "$DESTINATION_DIR/$TMP_DATA_DIR" ]; then
if ask_question_yn "Do you want to remove the temporary directory $DESTINATION_DIR/$TMP_DATA_DIR ?"; then
rm -rf "$DESTINATION_DIR/$TMP_DATA_DIR" > /dev/null
if [ ! -d "$DESTINATION_DIR/$TMP_DATA_DIR" ]; then
uprintf "Temporary directory removed successfully.\n"
else
uprintf "Cannot remove temporary directory.\n"
fi
fi
fi
fi
Expand Down

0 comments on commit 0866a4d

Please sign in to comment.