mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Extract error trapping to its own file
This commit is contained in:
37
install/preflight/trap-errors.sh
Normal file
37
install/preflight/trap-errors.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/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 [[ -n $OMARCHY_BARE ]]; then
|
||||
echo "You can retry by running: OMARCHY_BARE=true bash ~/.local/share/omarchy/install.sh"
|
||||
else
|
||||
echo "You can retry by running: bash ~/.local/share/omarchy/install.sh"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -z "${OMARCHY_CHROOT_INSTALL:-}" ]; then
|
||||
# ISO installer has its own trap we need to stay in the chroot
|
||||
trap catch_errors ERR
|
||||
fi
|
||||
Reference in New Issue
Block a user