Skip to content

Commit 1e9a2b5

Browse files
authored
refactor: UX: ClearLogs::execute() error message is misleading after interactive 'n' (#10126)
1 parent 74982b1 commit 1e9a2b5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

system/Commands/Housekeeping/ClearLogs.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public function run(array $params)
6868

6969
if (! $force && CLI::prompt('Are you sure you want to delete the logs?', ['n', 'y']) === 'n') {
7070
CLI::error('Deleting logs aborted.');
71-
CLI::error('If you want, use the "--force" option to force delete all log files.');
71+
72+
// @todo to re-add under non-interactive mode
73+
// CLI::error('If you want, use the "--force" option to force delete all log files.');
7274

7375
return EXIT_ERROR;
7476
}

tests/system/Commands/Housekeeping/ClearLogsTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ public function testClearLogsAbortsClearWithoutForce(): void
9898
<<<'EOT'
9999
Are you sure you want to delete the logs? [n, y]: n
100100
Deleting logs aborted.
101-
If you want, use the "--force" option to force delete all log files.
102101

103102
EOT,
104103
preg_replace('/\e\[[^m]+m/', '', $io->getOutput()),
@@ -122,7 +121,6 @@ public function testClearLogsAbortsClearWithoutForceWithDefaultAnswer(): void
122121
<<<EOT
123122
Are you sure you want to delete the logs? [n, y]:{$space}
124123
Deleting logs aborted.
125-
If you want, use the "--force" option to force delete all log files.
126124
127125
EOT,
128126
preg_replace('/\e\[[^m]+m/', '', $io->getOutput()),

0 commit comments

Comments
 (0)