Skip to content

✨ feat: Add -y flag to delete-user script for non-interactive use#12241

Open
leondape wants to merge 1 commit intodanny-avila:mainfrom
leondape:feat/delete-user-y-flag
Open

✨ feat: Add -y flag to delete-user script for non-interactive use#12241
leondape wants to merge 1 commit intodanny-avila:mainfrom
leondape:feat/delete-user-y-flag

Conversation

@leondape
Copy link
Contributor

Summary

  • Adds -y flag support to config/delete-user.js to skip interactive confirmation prompts
  • First -y skips the "Really delete user?" confirmation
  • Second -y also skips the "Delete transaction history?" prompt (defaults to yes)
  • Without any -y flags, the script behaves exactly as before (interactive prompts)

Why

The delete-user script currently requires interactive input, making it unusable in CI/CD pipelines or automation scripts. This change enables non-interactive execution while preserving the existing interactive behavior as the default.

Usage

# Interactive (unchanged behavior)
npm run delete-user

# Skip deletion confirmation only
npm run delete-user -- -y user@example.com

# Skip both confirmations (full automation)
npm run delete-user -- -y -y user@example.com

Adds support for `-y` flags to skip interactive confirmation prompts,
enabling use in CI/CD pipelines and automation scripts.

- First `-y`: skips the "Really delete user?" confirmation
- Second `-y`: also skips the "Delete transaction history?" prompt (defaults to yes)
- Without `-y`, the script behaves exactly as before (interactive prompts)

Usage: `npm run delete-user -- -y -y user@example.com`
Made-with: Cursor
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds non-interactive confirmation flags to the config/delete-user.js admin script to support safer automation while keeping the existing interactive prompts as the default behavior.

Changes:

  • Parse CLI args to support -y confirmation flags (repeatable).
  • Skip the full-deletion confirmation prompt when -y is provided.
  • Skip the transaction-deletion prompt (and delete transactions) when -y is provided twice.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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