Fix http-server on Windows
This commit is contained in:
@@ -22,7 +22,7 @@ class ProjectXMLParser extends HXProject {
|
||||
|
||||
public var includePaths:Array <String>;
|
||||
|
||||
private static var varMatch = new EReg("\\${(.*?)}", "");
|
||||
private static var varMatch = new EReg ("\\${(.*?)}", "");
|
||||
|
||||
|
||||
public function new (path:String = "", defines:Map <String, Dynamic> = null, includePaths:Array <String> = null, useExtensionPath:Bool = false) {
|
||||
@@ -97,7 +97,7 @@ class ProjectXMLParser extends HXProject {
|
||||
|
||||
defines.set ("html5", "1");
|
||||
|
||||
} else if (targetFlags.exists ("cpp") || ((platformType != PlatformType.WEB) && !targetFlags.exists("html5")) || target == Platform.EMSCRIPTEN) {
|
||||
} else if (targetFlags.exists ("cpp") || ((platformType != PlatformType.WEB) && !targetFlags.exists ("html5")) || target == Platform.EMSCRIPTEN) {
|
||||
|
||||
defines.set ("native", "1");
|
||||
defines.set ("cpp", "1");
|
||||
@@ -1157,17 +1157,25 @@ class ProjectXMLParser extends HXProject {
|
||||
|
||||
case "haxedef":
|
||||
|
||||
var name = substitute (element.att.name);
|
||||
var value = "";
|
||||
if (element.has.remove) {
|
||||
|
||||
if (element.has.value) {
|
||||
haxedefs.remove (substitute (element.att.remove));
|
||||
|
||||
value = substitute (element.att.value);
|
||||
} else {
|
||||
|
||||
var name = substitute (element.att.name);
|
||||
var value = "";
|
||||
|
||||
if (element.has.value) {
|
||||
|
||||
value = substitute (element.att.value);
|
||||
|
||||
}
|
||||
|
||||
haxedefs.set (name, value);
|
||||
|
||||
}
|
||||
|
||||
haxedefs.set (name, value);
|
||||
|
||||
case "haxeflag", "compilerflag":
|
||||
|
||||
var flag = substitute (element.att.name);
|
||||
|
||||
@@ -81,16 +81,19 @@ function listen(port) {
|
||||
|
||||
var server = httpServer.createServer(options);
|
||||
server.listen(port, host, function() {
|
||||
var uri = [ssl ? 'https' : 'http', '://', host, ':', port].join('');
|
||||
var protocol = ssl ? 'https:' : 'http:';
|
||||
var canonical_host = host === "0.0.0.0" ? "localhost" : host;
|
||||
var uri = protocol + '//' + host + ':' + port;
|
||||
var canonical_uri = protocol + '//' + canonical_host + ':' + port;
|
||||
log('Starting up http-server, serving '.yellow
|
||||
+ server.root.cyan
|
||||
+ ((ssl) ? ' through'.yellow + ' https'.cyan : '')
|
||||
+ (ssl ? ' through'.yellow + ' https'.cyan : '')
|
||||
+ ' on: '.yellow
|
||||
+ uri.cyan);
|
||||
|
||||
log('Hit CTRL-C to stop the server');
|
||||
if (argv.o) {
|
||||
opener(uri);
|
||||
opener(canonical_uri);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user