Skip to content

Commit

Permalink
install.sh: slightly better feedback for setup commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Jan 10, 2024
1 parent 5e294af commit f0e3f93
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ venv_check() {
check_for_error() {
if [ $? -ne 0 ]; then
CMD_ERRORS=true
warning "^^^ 😬"
warning "^^^ 😬 previous command did not exit cleanly!"
fi
}

Expand Down Expand Up @@ -290,14 +290,18 @@ fi

find_config

printf "\n"

# Run the setup commands from pyproject.toml / tool.pimoroni.commands

inform "Running setup commands...\n"
for ((i = 0; i < ${#SETUP_CMDS[@]}; i++)); do
CMD="${SETUP_CMDS[$i]}"
# Attempt to catch anything that touches config.txt and trigger a backup
if [[ "$CMD" == *"raspi-config"* ]] || [[ "$CMD" == *"$CONFIG_DIR/$CONFIG_FILE"* ]] || [[ "$CMD" == *"\$CONFIG_DIR/\$CONFIG_FILE"* ]]; then
do_config_backup
fi
printf "\"%s\"\n" "$CMD"
eval "$CMD"
check_for_error
done
Expand Down Expand Up @@ -365,4 +369,4 @@ if [ "$CMD_ERRORS" = true ]; then
exit 1
else
exit 0
fi
fi

0 comments on commit f0e3f93

Please sign in to comment.