Browse Source

auto detect cdb based on app name

Nicolas Cannasse 6 years ago
parent
commit
6dc0c8fcef
3 changed files with 14 additions and 1 deletions
  1. 12 0
      bin/package-cdb.json
  2. 1 1
      hide/Ide.hx
  3. 1 0
      libs/nw/App.hx

+ 12 - 0
bin/package-cdb.json

@@ -0,0 +1,12 @@
+{
+	"name" : "CDB",
+	"window" : {
+		"title" : "CDB",
+		"icon" : "res/cdb.png",
+		"width" : 800,
+		"height" : 600,
+		"show" : true
+	},
+	"main" : "app.html",
+	"js-flags": "--expose-gc"
+}

+ 1 - 1
hide/Ide.hx

@@ -52,7 +52,7 @@ class Ide {
 	static var firstInit = true;
 
 	function new() {
-		isCDB = Sys.getEnv("HIDE_START_CDB") == "1";
+		isCDB = Sys.getEnv("HIDE_START_CDB") == "1" || nw.App.manifest.name == "CDB";
 		function wait() {
 			if( monaco.Editor == null ) {
 				haxe.Timer.delay(wait, 10);

+ 1 - 0
libs/nw/App.hx

@@ -3,6 +3,7 @@ package nw;
 extern class App {
 
 	public static var argv(default, never) : Array<String>;
+	public static var manifest(default, never) : Dynamic;
 	public static var dataPath(default, never) : String;
 	public static function on( event : String, callb : String -> Void ) : Void;
 	public static function clearCache( ) : Void;