From a1026dd6cbecbcb6693b1fe008cd225b6ad9c08b Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Tue, 21 Apr 2026 17:46:13 +0800 Subject: [PATCH] refactor: UX: `ClearLogs::execute()` error message is misleading after interactive `'n'` --- system/Commands/Housekeeping/ClearLogs.php | 4 +++- tests/system/Commands/Housekeeping/ClearLogsTest.php | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/Commands/Housekeeping/ClearLogs.php b/system/Commands/Housekeeping/ClearLogs.php index 71f299969055..e416a383cc48 100644 --- a/system/Commands/Housekeeping/ClearLogs.php +++ b/system/Commands/Housekeeping/ClearLogs.php @@ -68,7 +68,9 @@ public function run(array $params) if (! $force && CLI::prompt('Are you sure you want to delete the logs?', ['n', 'y']) === 'n') { CLI::error('Deleting logs aborted.'); - CLI::error('If you want, use the "--force" option to force delete all log files.'); + + // @todo to re-add under non-interactive mode + // CLI::error('If you want, use the "--force" option to force delete all log files.'); return EXIT_ERROR; } diff --git a/tests/system/Commands/Housekeeping/ClearLogsTest.php b/tests/system/Commands/Housekeeping/ClearLogsTest.php index 09c889a6e573..a8469873e84d 100644 --- a/tests/system/Commands/Housekeeping/ClearLogsTest.php +++ b/tests/system/Commands/Housekeeping/ClearLogsTest.php @@ -98,7 +98,6 @@ public function testClearLogsAbortsClearWithoutForce(): void <<<'EOT' Are you sure you want to delete the logs? [n, y]: n Deleting logs aborted. - If you want, use the "--force" option to force delete all log files. EOT, preg_replace('/\e\[[^m]+m/', '', $io->getOutput()), @@ -122,7 +121,6 @@ public function testClearLogsAbortsClearWithoutForceWithDefaultAnswer(): void <<getOutput()),