| 14 | } |
| 15 | |
| 16 | String createRelativePath(String fromFile, String toFile) { |
| 17 | if (!File::isDirectory(fromFile)) |
| 18 | fromFile = File::dirName(fromFile); |
| 19 | fromFile = File::fullPath(fromFile); |
| 20 | toFile = File::fullPath(toFile); |
| 21 | |
| 22 | StringList fromParts = fromFile.splitAny("/\\"); |
| 23 | StringList toParts = toFile.splitAny("/\\"); |
| 24 | removeCommonPrefix(fromParts, toParts); |
| 25 | |
| 26 | StringList relativeParts; |
| 27 | for (String part : fromParts) |
| 28 | relativeParts.append(".."); |
| 29 | relativeParts.appendAll(toParts); |
| 30 | |
| 31 | return relativeParts.join("/"); |
| 32 | } |
| 33 | |
| 34 | Maybe<Json> repairTileset(Json tileset, String const& mapPath, String const& tilesetPath) { |
| 35 | if (tileset.contains("source")) |
no test coverage detected