1
0
Fork 0
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:
Austin McKinley 2018-07-25 12:05:08 -07:00
parent 6bdd74584e
commit ee7879e626

View file

@ -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) {