Skip to content

cli/overlay.sh: fix inverted yesno guard in __overlay_reset#54

Closed
Dev-X25874 wants to merge 1 commit into
vicharak-in:mainfrom
Dev-X25874:fix/cli-overlay-reset-yesno-guard
Closed

cli/overlay.sh: fix inverted yesno guard in __overlay_reset#54
Dev-X25874 wants to merge 1 commit into
vicharak-in:mainfrom
Dev-X25874:fix/cli-overlay-reset-yesno-guard

Conversation

@Dev-X25874

Copy link
Copy Markdown

Problem

__overlay_reset in cli/overlay.sh had an inverted confirmation guard.

yesno_cli returns 0 when the user types "yes" and 1 when they type
"no". The existing code used:

if yesno_cli "WARNING..."; then
    return
fi

This means a user confirming the reset ("yes") would silently abort,
while a user declining ("no") would trigger the destructive
reset_overlays call — the exact opposite of intent.

The TUI counterpart (tui/overlay/overlay.sh) and __overlay_install
in the same file both correctly use if ! yesno_cli as the abort
guard.

Fix

Add the missing ! on line 261:

if ! yesno_cli "WARNING..."; then
    return
fi

Test

Added cli/test/overlay_reset_test.sh which stubs all external
dependencies and asserts:

  • answering "yes" calls reset_overlays exactly once
  • answering "no" does not call reset_overlays

@djkabutar djkabutar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR, can you mention the fix in the commit message as well, it will be easier to track there. You can check previous commits for more reference.

@Dev-X25874

Copy link
Copy Markdown
Author

Hey @djkabutar, done! Updated the commit message to follow the project's convention. Let me know if anything else needs changing.

@djkabutar

Copy link
Copy Markdown
Member

you have made the changes but, you have created extra commit on top of the other commits & which is empty commit, which is not required, you need to rebase and reword the commits and force push it in order to reflect properly

@Dev-X25874 Dev-X25874 force-pushed the fix/cli-overlay-reset-yesno-guard branch from 2f4245f to a38350f Compare June 25, 2026 04:22
@Dev-X25874

Copy link
Copy Markdown
Author

@djkabutar done! Squashed all 3 commits into 1 clean commit. Let me know if anything else needs changing.

@Dev-X25874

Copy link
Copy Markdown
Author

@djkabutar sorry for the confusion earlier with the extra commits. Should be clean now — let me know if anything else needs fixing.

@Dev-X25874 Dev-X25874 closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants