Catch errors
This commit is contained in:
1 parent
e8e442444a
commit
5994ea63e5
1 file changed
+17
@@ -1,6 +1,23 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
catch_errors() {
|
||||||
|
echo -e "\n\e[31mOmarchy installation failed!\e[0m"
|
||||||
|
echo "The failing command was: \`$BASH_COMMAND\` (exit code: $?)"
|
||||||
|
echo "Get help from the community: https://discord.gg/tXFUdasqhY"
|
||||||
|
|
||||||
|
if [[ -n $OMARCHY_USER ]]; then
|
||||||
|
echo "You can retry by running: bash ~/.local/share/omarchy/install.sh"
|
||||||
|
HOME=/home/$OMARCHY_USER \
|
||||||
|
arch-chroot -u $OMARCHY_USER /mnt/ \
|
||||||
|
env OMARCHY_USER_NAME="$(<user_full_name.txt)" \
|
||||||
|
OMARCHY_USER_EMAIL="$(<user_email_address.txt)" \
|
||||||
|
/bin/bash
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
trap catch_errors ERR
|
||||||
|
|
||||||
if [[ $(tty) == "/dev/tty1" ]]; then
|
if [[ $(tty) == "/dev/tty1" ]]; then
|
||||||
NETWORK_NEEDED=1 ./installer
|
NETWORK_NEEDED=1 ./installer
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user