diff --git a/ScriptHandler.php b/ScriptHandler.php index 9323236..b477360 100644 --- a/ScriptHandler.php +++ b/ScriptHandler.php @@ -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()); diff --git a/tests/CopyFileTest.php b/tests/CopyFileTest.php index 1bca11b..4b212f7 100644 --- a/tests/CopyFileTest.php +++ b/tests/CopyFileTest.php @@ -109,6 +109,7 @@ 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') @@ -116,6 +117,7 @@ public function testCopyFromComplexDir() $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() @@ -208,7 +210,10 @@ private function getFilesystem() 'file4' => 'Some content', 'sub_dir' => [ 'file5' => 'Some content', - ] + ], + 'git_keep_dir' => [ + '.gitkeep' => '', + ], ], ];