Skip to content

Commit 9f90c2f

Browse files
authored
Merge pull request #3085 from codeeu/dev
Add newline in description when update
2 parents 34a8bd8 + 21ece96 commit 9f90c2f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

app/Console/Commands/Onetime/UpdateResourceDescriptions.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ public function handle(): int
120120
'not_found' => array_filter($results, fn($r) => $r['status'] === 'NOT FOUND'),
121121
]);
122122

123+
$this->newLine();
124+
$duplicates = $data
125+
->groupBy(fn($row) => trim((string)($row['Name of the resource'] ?? $row[0] ?? '')))
126+
->map(fn($group) => $group->count())
127+
->filter(fn($count) => $count > 1);
128+
129+
if ($duplicates->isNotEmpty()) {
130+
$this->newLine(2);
131+
$this->warn('Duplicate resource titles detected:');
132+
$this->table(['Resource Name', 'Count'], $duplicates->map(fn($count, $name) => [$name, $count])->values());
133+
}
134+
123135
if ($dryRun) {
124136
$this->warn('Dry run only — no data was modified.');
125137
}
420 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)