Skip to content

Commit

Permalink
Filter the files to only include the selected ones
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 10, 2024
1 parent 8a93d7b commit 9ae61c9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ protected function handleInteractivePublish(): void
$selectedFiles = $this->promptForFiles($files, basename($target));

$this->infoComment(sprintf("Selected files [%s]\n", collect($selectedFiles)->map(fn (string $file): string => Str::after($file, basename($source).'/'))->implode(', ')));

// Now we filter the files to only include the selected ones
$selectedFiles = $files->filter(fn (string $file): bool => in_array($file, $selectedFiles));
}

protected function promptForFiles(Collection $files, string $baseDir): array
Expand Down

0 comments on commit 9ae61c9

Please sign in to comment.