Skip to content

Commit

Permalink
Merge pull request #8 from luklewluk/master
Browse files Browse the repository at this point in the history
Include files beginning with dot
  • Loading branch information
slowprog authored Dec 7, 2017
2 parents c76bcc6 + 8b596e6 commit 400c2b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function copy(Event $event)

if (is_dir($from)) {
$finder = new Finder;
$finder->files()->in($from);
$finder->files()->ignoreDotFiles(false)->in($from);

foreach ($finder as $file) {
$dest = sprintf('%s/%s', $to, $file->getRelativePathname());
Expand Down
7 changes: 6 additions & 1 deletion tests/CopyFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ public function testCopyFromComplexDir()

$this->assertFalse($root->hasChild('to/file4'));
$this->assertFalse($root->hasChild('to/sub_dir/file5'));
$this->assertFalse($root->hasChild('to/git_keep_dir'));

ScriptHandler::copy($this->getEventMock([
vfsStream::url('root/from_complex')=> vfsStream::url('root/to')
]));

$this->assertTrue($root->hasChild('to/file4'));
$this->assertTrue($root->hasChild('to/sub_dir/file5'));
$this->assertTrue($root->hasChild('to/git_keep_dir'));
}

public function testConfigError()
Expand Down Expand Up @@ -208,7 +210,10 @@ private function getFilesystem()
'file4' => 'Some content',
'sub_dir' => [
'file5' => 'Some content',
]
],
'git_keep_dir' => [
'.gitkeep' => '',
],
],
];

Expand Down

0 comments on commit 400c2b7

Please sign in to comment.