Extract error trapping to its own file
This commit is contained in:
parent
aa0b44b7f4
commit
2ae973108d
34
install.sh
34
install.sh
@ -6,39 +6,6 @@ set -e
|
|||||||
export PATH="$HOME/.local/share/omarchy/bin:$PATH"
|
export PATH="$HOME/.local/share/omarchy/bin:$PATH"
|
||||||
OMARCHY_INSTALL=~/.local/share/omarchy/install
|
OMARCHY_INSTALL=~/.local/share/omarchy/install
|
||||||
|
|
||||||
# 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
|
|
||||||
}
|
|
||||||
|
|
||||||
trap catch_errors ERR
|
|
||||||
|
|
||||||
show_logo() {
|
show_logo() {
|
||||||
clear
|
clear
|
||||||
tte -i ~/.local/share/omarchy/logo.txt --frame-rate ${2:-120} ${1:-expand}
|
tte -i ~/.local/share/omarchy/logo.txt --frame-rate ${2:-120} ${1:-expand}
|
||||||
@ -51,6 +18,7 @@ show_subtext() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Install prerequisites
|
# Install prerequisites
|
||||||
|
source $OMARCHY_INSTALL/preflight/trap-errors.sh
|
||||||
source $OMARCHY_INSTALL/preflight/chroot.sh
|
source $OMARCHY_INSTALL/preflight/chroot.sh
|
||||||
source $OMARCHY_INSTALL/preflight/mirrorlist.sh
|
source $OMARCHY_INSTALL/preflight/mirrorlist.sh
|
||||||
source $OMARCHY_INSTALL/preflight/guard.sh
|
source $OMARCHY_INSTALL/preflight/guard.sh
|
||||||
|
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
|
Loading…
x
Reference in New Issue
Block a user