mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +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,6 +24,17 @@ final class PhabricatorStorageManagementDestroyWorkflow
|
|||
$console = PhutilConsole::getConsole();
|
||||
|
||||
if (!$this->isDryRun() && !$this->isForce()) {
|
||||
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(
|
||||
|
@ -41,6 +52,7 @@ final class PhabricatorStorageManagementDestroyWorkflow
|
|||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$apis = $this->getMasterAPIs();
|
||||
foreach ($apis as $api) {
|
||||
|
|
Loading…
Reference in a new issue