Kaynağa Gözat

allow to start in current local project if exists (close #66)

Nicolas Cannasse 5 yıl önce
ebeveyn
işleme
ba9055c370
2 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 1 1
      hide/Config.hx
  2. 5 0
      hide/Ide.hx

+ 1 - 1
hide/Config.hx

@@ -128,7 +128,7 @@ class Config {
 				autoSaveLayout : true,
 				layouts : null,
 				recentProjects : [],
-				currentProject : projectPath,
+				currentProject : "",
 				windowPos : null,
 				renderer : null,
 			};

+ 5 - 0
hide/Ide.hx

@@ -73,6 +73,11 @@ class Ide {
 		window = nw.Window.get();
 		var cwd = Sys.getCwd();
 		config = Config.loadForProject(cwd, cwd+"/res");
+		if( ideConfig.currentProject == "" ) {
+			ideConfig.currentProject = cwd;
+			if( StringTools.endsWith(cwd,"package.nw") && sys.FileSystem.exists(cwd.substr(0,-10)+"res") )
+				ideConfig.currentProject = cwd.substr(0,-11);
+		}
 
 		var args = js.Browser.document.URL.split("?")[1];
 		if( args != null ) {