Fix watch command (resolves haxelime/hxp#23)

This commit is contained in:
Joshua Granick
2020-12-21 12:50:14 -08:00
parent a22d55762a
commit 79e21c8312
9 changed files with 81 additions and 17 deletions

View File

@@ -139,7 +139,7 @@ class HTML5Platform extends PlatformTarget
}
}
private function getDisplayHXML():String
private function getDisplayHXML():HXML
{
var path = targetDirectory + "/haxe/" + buildType + ".hxml";
@@ -502,7 +502,15 @@ class HTML5Platform extends PlatformTarget
{
// TODO: Use a custom live reload HTTP server for test/run instead
var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path);
var hxml = getDisplayHXML();
var dirs = hxml.getClassPaths(true);
var outputPath = Path.combine(Sys.getCwd(), project.app.path);
dirs = dirs.filter(function(dir)
{
return (!Path.startsWith(dir, outputPath));
});
var command = ProjectHelper.getCurrentCommand();
System.watch(command, dirs);
}