UNPKG

intuition-cli

Version:
26 lines (25 loc) 880 B
import { Command } from '@oclif/core'; import inquirer from 'inquirer'; import { clearAccounts } from '../../config.js'; export default class AccountReset extends Command { static args = {}; static description = 'Remove all existing accounts after confirmation.'; static examples = ['<%= config.bin %> <%= command.id %>']; static flags = {}; async run() { this.log('This will remove ALL accounts and cannot be undone!'); const response = await inquirer.prompt([ { message: 'Type "confirm" to proceed:', name: 'confirm', type: 'input', }, ]); if (response.confirm !== 'confirm') { this.log('Aborted. No accounts were deleted.'); return; } clearAccounts(); this.log('All accounts have been deleted.'); } }