Refactor script logic, enhance error handling, and fix progress calcu…#2
Refactor script logic, enhance error handling, and fix progress calcu…#2just-some-tall-bloke wants to merge 1 commit intoroto31:mainfrom
Conversation
just-some-tall-bloke
commented
Feb 22, 2026
- Fixed Bugs: Resolved infinite loops on cancellation, corrected progress bar math, and initialized missing variables.
- Improved Reliability: Added checks for the dialog binary and implemented proper quoting for variables with spaces.
- Cleanup: Removed duplicate variable definitions and deleted dead code/comments.
…lation Fixed Bugs: Resolved infinite loops on cancellation, corrected progress bar math, and initialised missing variables. Improved Reliability: Added checks for the dialog binary and implemented proper quoting for variables with spaces. Cleanup: Removed duplicate variable definitions and deleted dead code/comments.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2928ee0ba5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [[ "$result" == *"button2"* ]] || [[ -z "$result" ]]; then | ||
| echo "User cancelled or no application selected" | ||
| exit 0 |
There was a problem hiding this comment.
Return nonzero when dialog output is unexpectedly empty
Treating an empty result as a successful cancel (exit 0) hides real execution failures: when dialog cannot display (for example, non-interactive/GUI-unavailable runs or runtime invocation errors), stdout is also empty, so the script exits successfully even though no install happened. This causes calling automation to mark the run as success. Handle true cancel separately and return a nonzero status for empty output that comes from command failure.
Useful? React with 👍 / 👎.