1 2 3 4 5 6 7 8 9 10
pre_remove() { echo "Removing all Swift installations..." runuser -l $SUDO_USER -c 'swiftly uninstall all -y' } post_remove() { if [ -d /home/$SUDO_USER/.local/share/swiftly ]; then rm -rf /home/$SUDO_USER/.local/share/swiftly fi }