Skip to content

Commit 3f0aee1

Browse files
committed
Improve CLI verbose logs
1 parent 49c7327 commit 3f0aee1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Commands/Deploy.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,12 @@ private function getGitDetails(): array
228228
$gitMessage = explode("\n", $gitMessage)[0];
229229

230230
IO::verbose('Git ref: ' . $gitRef);
231-
IO::verbose('Git message: ' . $gitMessage);
231+
$gitMessageLog = explode("\n", $gitMessage)[0] ?? '';
232+
IO::verbose(sprintf(
233+
'Git commit message: "%s%s"',
234+
substr($gitMessageLog, 0, 80),
235+
strlen($gitMessage) > 80 ? '' : '',
236+
));
232237

233238
return [$gitRef, $gitMessage];
234239
}
@@ -295,16 +300,14 @@ private function packageArtifact(string $id, string $path, array $patterns): str
295300
$pattern = str_replace(['\\', '/', '.', '**', '*'], ['\\\\', '\/', '\.', '.+', '[^\/\\\\]+'], $pattern);
296301
$regex = "/^$pattern$/";
297302
$patternRegexes[$regex] = $include;
298-
299-
IO::verbose(($include ? 'Including' : 'Excluding') . " files matching: $pattern");
300303
}
301304

302305
$archivePath = ".bref/package-$id.zip";
303306

304307
$zip = new ZipArchive;
305308
$zip->open($archivePath, ZipArchive::CREATE | ZipArchive::OVERWRITE);
306309
$this->addFolderToArchive($zip, $path, $patternRegexes, $path);
307-
IO::verbose('Writing zip');
310+
IO::verbose("Writing $archivePath");
308311
$zip->close();
309312

310313
return $archivePath;
@@ -335,8 +338,6 @@ private function addFolderToArchive(ZipArchive $zip, string $path, array $patter
335338
}
336339
if ($match) {
337340
if (! $shouldInclude) {
338-
// This file should be excluded
339-
IO::verbose('Excluding ' . $filepath);
340341
continue 2;
341342
}
342343
// Get out of the loop because this file needs to be included

0 commit comments

Comments
 (0)