mirror of
https://github.com/basecamp/omarchy.git
synced 2025-08-01 22:39:24 +00:00
Just use set -e instead of manually checking for return values
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit immediately if a command exits with a non-zero status
|
||||||
|
set -e
|
||||||
|
|
||||||
STATE_DIR="$HOME/.local/state/omarchy/migrations"
|
STATE_DIR="$HOME/.local/state/omarchy/migrations"
|
||||||
|
|
||||||
cd ~/.local/share/omarchy
|
cd ~/.local/share/omarchy
|
||||||
@ -20,13 +23,8 @@ for file in migrations/*.sh; do
|
|||||||
[ -e "${STATE_DIR}/$filename" ] && continue
|
[ -e "${STATE_DIR}/$filename" ] && continue
|
||||||
|
|
||||||
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
|
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
|
||||||
if source $file; then
|
source $file
|
||||||
touch "${STATE_DIR}/$filename"
|
touch "${STATE_DIR}/$filename"
|
||||||
echo -e "\t\e[32m✔ Succeess\e[0m"
|
|
||||||
else
|
|
||||||
echo -e "\t\e[31m✖ FAILED\e[0m"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Update system packages
|
# Update system packages
|
||||||
@ -35,3 +33,4 @@ yay -Syu --noconfirm
|
|||||||
|
|
||||||
# Back to where we came from
|
# Back to where we came from
|
||||||
cd - >/dev/null
|
cd - >/dev/null
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user