bin/delete_yum_repo
2024-08-09 19:08:50 -05:00

17 lines
492 B
Bash
Executable File

#!/usr/bin/env zsh
selection=$(find /etc/yum.repos.d -type f -name "*.repo" | gum choose --no-limit)
format_string_array=(
"# You selected the following repo file(s):\n"
)
echo "$selection" | while read -r line; do format_string_array+=("- $line\n"); done
echo "${format_string_array[@]}" | gum format
echo ""
if gum confirm "Are you sure you want to delete?"; then
sudo rm -v $(echo "$selection")
else
echo ":raised_eyebrow: Oh, okay then. Carry on." | gum format -t emoji
fi