Skip to content

Commit fc47354

Browse files
committed
Add * option to include the entire base directory
1 parent 855f9f7 commit fc47354

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.1.4 - 2021-06-05
4+
5+
- Added `*` option to include the entire base directory in the package.
6+
37
## 0.1.3 - 2021-05-24
48

59
- Fix more `sidecar:configure` AWS errors.

src/Package.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ public function getBasePath()
250250
protected function pathsForMerging($paths)
251251
{
252252
return array_map(function ($path) {
253+
// `*` means everything in the base directory, whatever
254+
// that may be. By resetting it to an empty string and
255+
// prepending the base path, everything is included.
256+
if ($path === '*') {
257+
$path = '';
258+
}
259+
253260
// Make every path relative to the base directory.
254261
return $this->prependBasePath($path);
255262
}, Arr::wrap($paths));

tests/PackageTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@ public function it_sets_the_base_path_correctly()
9999
}
100100
}
101101

102+
/** @test */
103+
public function start_includes_everything_in_base_path()
104+
{
105+
$package = $this->makePackageClass();
106+
107+
$package->setBasePath(__DIR__ . '/Support/Files');
108+
$package->include('*');
109+
110+
$this->assertCount(3, $package->files());
111+
}
112+
102113
/** @test */
103114
public function base_path_order()
104115
{

0 commit comments

Comments
 (0)