mirror of https://github.com/buggins/dlangide.git
Create source directory for empty projects
Since the preview shows the creation of a source directory and since there currently is no functionality to add new source paths to a project, empty projects were effectively unusable after creation unless you manually created files/directories for them outside DlangIDE.
This commit is contained in:
parent
6fdb8812c4
commit
d69db6a3e6
|
@ -355,10 +355,10 @@ class NewProjectDlg : Dialog {
|
||||||
ws.addProject(project);
|
ws.addProject(project);
|
||||||
if (ws.startupProject is null)
|
if (ws.startupProject is null)
|
||||||
ws.startupProject = project;
|
ws.startupProject = project;
|
||||||
|
string srcdir = buildNormalizedPath(pdir, "source");
|
||||||
|
if (!exists(srcdir))
|
||||||
|
mkdir(srcdir);
|
||||||
if (!_currentTemplate.srcfile.empty && !_currentTemplate.srccode.empty) {
|
if (!_currentTemplate.srcfile.empty && !_currentTemplate.srccode.empty) {
|
||||||
string srcdir = buildNormalizedPath(pdir, "source");
|
|
||||||
if (!exists(srcdir))
|
|
||||||
mkdir(srcdir);
|
|
||||||
string srcfile = buildNormalizedPath(srcdir, _currentTemplate.srcfile);
|
string srcfile = buildNormalizedPath(srcdir, _currentTemplate.srcfile);
|
||||||
write(srcfile, _currentTemplate.srccode);
|
write(srcfile, _currentTemplate.srccode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue