From 8f1056dc5f4236758b6f11e8c1442d650af99b5c Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Wed, 7 Feb 2018 20:50:35 +0100 Subject: [PATCH] Normalizing paths This doesn't affect behavior but makes for nicer error messages. --- .../com/rhubarb_lip_sync/rhubarb_for_spine/SpineJson.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/rhubarb-for-spine/src/main/kotlin/com/rhubarb_lip_sync/rhubarb_for_spine/SpineJson.kt b/extras/rhubarb-for-spine/src/main/kotlin/com/rhubarb_lip_sync/rhubarb_for_spine/SpineJson.kt index 91edb5f..12f784e 100644 --- a/extras/rhubarb-for-spine/src/main/kotlin/com/rhubarb_lip_sync/rhubarb_for_spine/SpineJson.kt +++ b/extras/rhubarb-for-spine/src/main/kotlin/com/rhubarb_lip_sync/rhubarb_for_spine/SpineJson.kt @@ -36,7 +36,7 @@ class SpineJson(val filePath: Path) { ?: throw Exception("JSON file is incomplete: Images path is missing." + "Make sure to check 'Nonessential data' when exporting.") - val imagesDirectoryPath = fileDirectoryPath.resolve(relativeImagesDirectory) + val imagesDirectoryPath = fileDirectoryPath.resolve(relativeImagesDirectory).normalize() if (!Files.exists(imagesDirectoryPath)) { throw Exception("Could not find images directory relative to the JSON file." + " Make sure the JSON file is in the same directory as the original Spine file.") @@ -50,7 +50,7 @@ class SpineJson(val filePath: Path) { ?: throw Exception("JSON file is incomplete: Audio path is missing." + "Make sure to check 'Nonessential data' when exporting.") - val audioDirectoryPath = fileDirectoryPath.resolve(relativeAudioDirectory) + val audioDirectoryPath = fileDirectoryPath.resolve(relativeAudioDirectory).normalize() if (!Files.exists(audioDirectoryPath)) { throw Exception("Could not find audio directory relative to the JSON file." + " Make sure the JSON file is in the same directory as the original Spine file.")