bin/delete_yum_repo

17 lines
492 B
Plaintext
Raw Normal View History

2024-08-10 02:08:50 +02:00
#!/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