Skip to content

Commit

Permalink
Fix for space in path and windows drive letter
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyjul committed Nov 12, 2024
1 parent 1a7e579 commit c4cf9f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"contributors": ["crazyjul"],
"dependencies": {
"haxe-files": ""
},
}
}
8 changes: 7 additions & 1 deletion src/assetman/Builder.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ abstract class Builder {
function setupUtilRules(ninja : NinjaBuilder, srcPath : String) {
// Setup rule for building file list file
var compareEchoPath = hx.files.Path.of(Sys.programPath()).parent.getAbsolutePath() + '/compare_echo.n';
compareEchoPath = compareEchoPath.replace(" ", "$ ").replace(":", "$:");
var command = 'neko ' + compareEchoPath + ' "$$glob" $$out $$path';
ninja.rule('COMPARE_ECHO')
.restat(true)
Expand Down Expand Up @@ -184,6 +185,8 @@ 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 filepath = hx.files.Path.of(file);
var filename = filepath.filenameStem;
var directory = filepath.parent.getAbsolutePath();
Expand All @@ -195,7 +198,9 @@ abstract class Builder {
.replace("$filename_without_extension", filename_without_extension)
.replace("$filename", filename)
.replace("$filepath", relative_filepath)
.replace("$directory", directory);
.replace("$directory", directory)
.replace(" ", "$ ")
.replace(":", "$:");
});

var assignments = new Map();
Expand Down Expand Up @@ -316,6 +321,7 @@ abstract class Builder {
var srcFileList = '.src_files';
// generate glob watcher for patterns in the soruce dir
generateGlobLists(ninja, srcFileList, params.srcPatterns, srcPath);
generatorPath = generatorPath.replace(" ", "$ ").replace(":", "$:");
// ninja generator command
ninja.edge(['build.ninja'])
.from([generatorPath, srcFileList])
Expand Down

0 comments on commit c4cf9f1

Please sign in to comment.