From 14781520903748f15eeeda23a32826e5ff2164a3 Mon Sep 17 00:00:00 2001 From: Julien Hamaide Date: Mon, 30 Dec 2024 12:30:58 +0100 Subject: [PATCH 1/2] Fix for files at the root of asset directory --- src/assetman/Builder.hx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/assetman/Builder.hx b/src/assetman/Builder.hx index 3e33360..04cf2ab 100644 --- a/src/assetman/Builder.hx +++ b/src/assetman/Builder.hx @@ -184,12 +184,13 @@ abstract class Builder { var relative_directory = parent != null ? relativePath(FileSystem.absolutePath(""), parent.getAbsolutePath()) : ""; - var input_path = Path.join([srcPath, file]); - var input_path = input_path.replace(" ", "$ "); - var input_path = input_path.replace(":", "$:"); + var input_path = Path.join([srcPath, file]) + .replace(" ", "$ ") + .replace(":", "$:"); var filepath = hx.files.Path.of(file); var filename = filepath.filenameStem; - var directory = filepath.parent.getAbsolutePath(); + + var directory = hx.files.Path.of(filepath.getAbsolutePath()).parent.getAbsolutePath(); var relative_filepath = Path.join([relative_directory, filename]); var filename_without_extension = directory + '/' + filename; From a14b81a57fb8f39237a2e1eca7e3c75520204921 Mon Sep 17 00:00:00 2001 From: Julien Hamaide Date: Mon, 30 Dec 2024 12:31:23 +0100 Subject: [PATCH 2/2] New to get extension in the output --- src/assetman/Builder.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/assetman/Builder.hx b/src/assetman/Builder.hx index 04cf2ab..cad2538 100644 --- a/src/assetman/Builder.hx +++ b/src/assetman/Builder.hx @@ -193,6 +193,7 @@ abstract class Builder { var directory = hx.files.Path.of(filepath.getAbsolutePath()).parent.getAbsolutePath(); var relative_filepath = Path.join([relative_directory, filename]); var filename_without_extension = directory + '/' + filename; + var ext = filepath.filenameExt; var output_paths = single.targets.map(function(a) { return a @@ -200,6 +201,7 @@ abstract class Builder { .replace("$filename", filename) .replace("$filepath", relative_filepath) .replace("$directory", directory) + .replace("$ext", ext) .replace(" ", "$ ") .replace(":", "$:"); });