Skip to content

Commit b56024c

Browse files
committed
Cleanup and move up output
1 parent dcd1a12 commit b56024c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/framework/src/Console/Commands/PublishViewsCommand.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,16 @@ protected function handleInteractivePublish(): void
135135

136136
// Now we need to prompt the user for which files to publish
137137
$selectedFiles = $this->promptForFiles($files, basename($target));
138+
139+
$this->infoComment(sprintf("Selected files [%s]\n", collect($selectedFiles)->map(fn (string $file): string => Str::after($file, basename($source).'/'))->implode(', ')));
138140
}
139141

140142
protected function promptForFiles(Collection $files, string $baseDir): array
141143
{
142-
$choices = $files->mapWithKeys(/** @return array<string, string> */ function (string $source, string $target) use ($baseDir, $files): array {
144+
$choices = $files->mapWithKeys(/** @return array<string, string> */ function (string $source) use ($baseDir): array {
143145
return [$source => Str::after($source, $baseDir.'/')];
144146
});
145147

146-
$selected = multiselect('Select the files you want to publish', $choices, [], 10, 'required', hint: 'Navigate with arrow keys, space to select, enter to confirm.');
147-
148-
$this->infoComment(sprintf("Selected files [%s]\n", implode(', ', $selected)));
149-
150-
return $selected;
148+
return multiselect('Select the files you want to publish', $choices, [], 10, 'required', hint: 'Navigate with arrow keys, space to select, enter to confirm.');
151149
}
152150
}

0 commit comments

Comments
 (0)