Skip to content

Commit

Permalink
Fix directory separation problems on Windows machine
Browse files Browse the repository at this point in the history
  • Loading branch information
BoGnY committed Sep 27, 2023
1 parent b4cbe14 commit 4665b73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Differ/PatchDiffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function diff(OldAndNewFile $oldAndNewFile): string

private function resolveRelativeFilePath(string $beforeFilePath): string
{
$match = Strings::match($beforeFilePath, self::LOCAL_PATH_REGEX);
$match = Strings::match(str_replace('\\', '/', $beforeFilePath), self::LOCAL_PATH_REGEX);

if (! isset($match['local_path'])) {
throw new ShouldNotHappenException();
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/PathResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class PathResolver

public static function resolveVendorDirectory(string $filePath): string
{
$match = Strings::match($filePath, self::VENDOR_PACKAGE_DIRECTORY_REGEX);
$match = Strings::match(str_replace('\\', '/', $filePath), self::VENDOR_PACKAGE_DIRECTORY_REGEX);
if (! isset($match['vendor_package_directory'])) {
throw new ShouldNotHappenException('Could not resolve vendor package directory');
}
Expand Down

0 comments on commit 4665b73

Please sign in to comment.