Browse Source

find template in ./std/tools as well.

Nicolas Cannasse 19 years ago
parent
commit
4caa46eeba
1 changed files with 9 additions and 1 deletions
  1. 9 1
      std/tools/haxedoc/Main.hx

+ 9 - 1
std/tools/haxedoc/Main.hx

@@ -648,7 +648,15 @@ class DocView {
 	}
 
 	public static function main() {
-		var hdata = try neko.File.getContent(Web.getCwd()+"template.xml") catch( e : Dynamic ) default_template;
+		var hdata =
+			try
+				neko.File.getContent(Web.getCwd()+"template.xml")
+			catch( e : Dynamic ) try {
+				var p = ~/[\/\\]/g.split(neko.Sys.executablePath());
+				p.pop();
+				neko.File.getContent(p.join("/")+"/std/tools/template.xml");
+			} catch( e : Dynamic )
+				default_template;
 		var html = Xml.parse(hdata).firstChild();
 		if( neko.Web.isModNeko ) {
 			var baseDir = "../data/media/";