Skip to content

Commit

Permalink
Fix normalizePath for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
msmakouz committed Nov 15, 2023
1 parent 472836b commit 55992c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions installer/Internal/Events/CopyEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ public function normalizePath(string $root, string $path): string
$source = \ltrim($path, '/');

if ($sourceRoot === '') {
return '/' . $source;
return \file_exists($source) ? $source : '/' . $source;
}

return '/' . $sourceRoot . '/' . $source;
return \file_exists($sourceRoot . '/' . $source)
? $sourceRoot . '/' . $source
: '/' . $sourceRoot . '/' . $source;
}

public function detectType(string $path): string
Expand Down

0 comments on commit 55992c8

Please sign in to comment.