Add more better error handling

I mean I guess it died but that's still bad
This commit is contained in:
Salt 2020-09-28 14:17:10 -05:00
parent 5484c4fec6
commit 60420623cc

View File

@ -226,12 +226,15 @@ step_preexecute() {
[ -n "$_optdryrun" ] && return 0
# Execute a user rc if it exists
[ -r "$HOME/.firestarterrc" ] && . "$HOME/.firestarterrc"
[ -n "$FIRESTARTER" ] && [ "$FIRESTARTER_DISPLAY" == "$DISPLAY" ] error "Firestarter is already running on $DISPLAY: $FIRESTARTER" 55
[ -n "$FIRESTARTER" ] && [ "$FIRESTARTER_DISPLAY" == "$DISPLAY" ] && error "Firestarter is already running on $DISPLAY: $FIRESTARTER" 55
export FIRESTARTER="$BASHPID"
export FIRESTARTER_DISPLAY="$DISPLAY"
export XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:-firestarter}"
# Create required directories
for dir in $_optconfigdir $_optdatadir $_optrundir $_optlogdir; do
if [ -z "$dir" ]; then
error "A required directory was not provided" 41
fi
if ! mkdir -p "$dir"; then
error "Failed to create critical directory: $dir" 41
fi