Commit 50852a3f authored by Tomáš Pospíšil's avatar Tomáš Pospíšil
Browse files

fix error parsing improvements

parent 2e14e490
......@@ -145,7 +145,7 @@ final class Dumper
return '';
}
return self::$rootDir;
return self::normalizePath(self::$rootDir);
}
/**
......@@ -209,7 +209,7 @@ final class Dumper
*/
private static function localizePath(string $file): string
{
self::$projectPath = self::$projectPath ?? PersistentValue::getCurrentValue(self::PROJECT_PATH);
self::$projectPath = self::$projectPath ?? self::normalizePath(PersistentValue::getCurrentValue(self::PROJECT_PATH));
if (!self::$projectPath) {
return $file;
}
......@@ -217,9 +217,14 @@ final class Dumper
$byLocalDirectory = Strings::replace($file, '#' . preg_quote(self::getDirectory(), '#') . '#', self::$projectPath);
if ($byLocalDirectory === $file) {
return Strings::replace($file, '#(?<serverPath>.*?\.(\w+)\/)#', self::$projectPath);
return Strings::replace($file, '#(?<serverPath>.*?\.(\w+))\/#', self::$projectPath);
}
return $byLocalDirectory;
}
private static function normalizePath(string $path): string
{
return Strings::trim($path, Strings::TRIM_CHARACTERS . '/');
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment