Skip to content

Commit 246bce6

Browse files
kmgalanakistheofidry
authored andcommitted
Fix "vendor" directories matching pattern for Windows (#310)
1 parent a986ff3 commit 246bce6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Console/Command/AddPrefixCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ private function scopeFiles(
195195
foreach ($filesWithContents as [$inputFilePath, $inputContents]) {
196196
$outputFilePath = $output.str_replace($commonPath, '', $inputFilePath);
197197

198-
if (preg_match('~((?:.*)\/vendor)\/.*~', $outputFilePath, $matches)) {
198+
$pattern = '~((?:.*)\\'.DIRECTORY_SEPARATOR.'vendor)\\'.DIRECTORY_SEPARATOR.'.*~';
199+
if (preg_match($pattern, $outputFilePath, $matches)) {
199200
$vendorDirs[$matches[1]] = true;
200201
}
201202

0 commit comments

Comments
 (0)