mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Change bin/storage destroy to be less scary when removing test data
Summary: I've pulled up this code probably three different times to make sure that the big scary warning does, in fact, still get printed even when passing `--unitest-fixtures` to `bin/storage destroy`. Make the warning message less scary if only removing test data. Test Plan: Ran with and without `--unitest-fixtures` and saw expected warnings. After agreeing to warnings, test data was deleted as expected. Did not test `bin/storage destroy` without `--unittest-fixtures`. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D19535
This commit is contained in:
parent
6bdd74584e
commit
ee7879e626
1 changed files with 25 additions and 13 deletions
|
@ -24,21 +24,33 @@ final class PhabricatorStorageManagementDestroyWorkflow
|
|||
$console = PhutilConsole::getConsole();
|
||||
|
||||
if (!$this->isDryRun() && !$this->isForce()) {
|
||||
$console->writeOut(
|
||||
phutil_console_wrap(
|
||||
pht(
|
||||
'Are you completely sure you really want to permanently destroy '.
|
||||
'all storage for Phabricator data? This operation can not be '.
|
||||
'undone and your data will not be recoverable if you proceed.')));
|
||||
if ($args->getArg('unittest-fixtures')) {
|
||||
$console->writeOut(
|
||||
phutil_console_wrap(
|
||||
pht(
|
||||
'Are you completely sure you really want to destroy all unit '.
|
||||
'test fixure data? This operation can not be undone.')));
|
||||
if (!phutil_console_confirm(pht('Destroy all unit test data?'))) {
|
||||
$console->writeOut("%s\n", pht('Cancelled.'));
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
$console->writeOut(
|
||||
phutil_console_wrap(
|
||||
pht(
|
||||
'Are you completely sure you really want to permanently destroy '.
|
||||
'all storage for Phabricator data? This operation can not be '.
|
||||
'undone and your data will not be recoverable if you proceed.')));
|
||||
|
||||
if (!phutil_console_confirm(pht('Permanently destroy all data?'))) {
|
||||
$console->writeOut("%s\n", pht('Cancelled.'));
|
||||
exit(1);
|
||||
}
|
||||
if (!phutil_console_confirm(pht('Permanently destroy all data?'))) {
|
||||
$console->writeOut("%s\n", pht('Cancelled.'));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!phutil_console_confirm(pht('Really destroy all data forever?'))) {
|
||||
$console->writeOut("%s\n", pht('Cancelled.'));
|
||||
exit(1);
|
||||
if (!phutil_console_confirm(pht('Really destroy all data forever?'))) {
|
||||
$console->writeOut("%s\n", pht('Cancelled.'));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue