Skip to content

Commit

Permalink
Merge pull request #5 from firefalcom/fix/root-file
Browse files Browse the repository at this point in the history
Fix for file in the asset root directory
  • Loading branch information
crazyjul authored Dec 31, 2024
2 parents 4db98f6 + a14b81a commit aa678bb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/assetman/Builder.hx
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,24 @@ 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;
var ext = filepath.filenameExt;

var output_paths = single.targets.map(function(a) {
return a
.replace("$filename_without_extension", filename_without_extension)
.replace("$filename", filename)
.replace("$filepath", relative_filepath)
.replace("$directory", directory)
.replace("$ext", ext)
.replace(" ", "$ ")
.replace(":", "$:");
});
Expand Down

0 comments on commit aa678bb

Please sign in to comment.