This commit is contained in:
@@ -12,9 +12,10 @@ while [[ "$#" -gt 0 ]]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
# If no folder path is provided, prompt the user for it
|
# If no folder path is provided, exit with an error
|
||||||
if [ -z "$folder_path" ]; then
|
if [ -z "$folder_path" ]; then
|
||||||
read -p "Enter the path to the folder: " folder_path
|
echo "No folder path provided. Exiting."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the provided path is valid
|
# Check if the provided path is valid
|
||||||
@@ -35,13 +36,9 @@ else
|
|||||||
echo "$trash_folders"
|
echo "$trash_folders"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Ask for confirmation before deletion if -y is not provided
|
# If the -y option is not provided, automatically confirm deletion
|
||||||
if [ "$auto_confirm" = false ]; then
|
if [ "$auto_confirm" = false ]; then
|
||||||
read -p "Do you really want to delete all these folders? (y/n): " confirmation
|
echo "Deleting all .Trash-1000 folders without confirmation..."
|
||||||
if [[ "$confirmation" != "y" && "$confirmation" != "Y" ]]; then
|
|
||||||
echo "Deletion canceled."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Loop through each found folder and delete it
|
# Loop through each found folder and delete it
|
||||||
|
|||||||
Reference in New Issue
Block a user