Files
omarchy/install/preflight/trap-errors.sh
David Heinemeier Hansson 9ca2081742 No confirm install only
2025-09-10 14:43:26 +02:00

38 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# Give people a chance to retry running the installation
catch_errors() {
echo -e "\n\e[31mOmarchy installation failed!\e[0m"
echo
echo "This command halted with exit code $?:"
echo "$BASH_COMMAND"
echo
echo "Get help from the community via QR code or at https://discord.gg/tXFUdasqhY"
echo " "
echo " █▀▀▀▀▀█ ▄ ▄ ▀▄▄▄█ █▀▀▀▀▀█ "
echo " █ ███ █ ▄▄▄▄▀▄▀▄▀ █ ███ █ "
echo " █ ▀▀▀ █ ▄█ ▄█▄▄▀ █ ▀▀▀ █ "
echo " ▀▀▀▀▀▀▀ ▀▄█ █ █ █ ▀▀▀▀▀▀▀ "
echo " ▀▀█▀▀▄▀▀▀▀▄█▀▀█ ▀ █ ▀ █ "
echo " █▄█ ▄▄▀▄▄ ▀ ▄ ▀█▄▄▄▄ ▀ ▀█ "
echo " ▄ ▄▀█ ▀▄▀▀▀▄ ▄█▀▄█▀▄▀▄▀█▀ "
echo " █ ▄▄█▄▀▄█ ▄▄▄ ▀ ▄▀██▀ ▀█ "
echo " ▀ ▀ ▀ █ ▀▄ ▀▀█▀▀▀█▄▀ "
echo " █▀▀▀▀▀█ ▀█ ▄▀▀ █ ▀ █▄▀██ "
echo " █ ███ █ █▀▄▄▀ █▀███▀█▄██▄ "
echo " █ ▀▀▀ █ ██ ▀ █▄█ ▄▄▄█▀ █ "
echo " ▀▀▀▀▀▀▀ ▀ ▀ ▀▀▀ ▀ ▀▀▀▀▀▀ "
echo " "
if command -v gum >/dev/null && gum confirm "Retry installation?"; then
bash ~/.local/share/omarchy/install.sh
else
echo "You can retry later by running: bash ~/.local/share/omarchy/install.sh"
fi
}
# Ensure gum is available as early as possible to retry errors
sudo pacman -S --noconfirm gum
trap catch_errors ERR