From d69db6a3e67f80b0d3aa1c514be83988b3dbbd7c Mon Sep 17 00:00:00 2001 From: default0 Date: Sat, 23 Jan 2016 15:39:24 +0100 Subject: [PATCH] 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. --- src/dlangide/ui/newproject.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dlangide/ui/newproject.d b/src/dlangide/ui/newproject.d index 69053db..08803e0 100644 --- a/src/dlangide/ui/newproject.d +++ b/src/dlangide/ui/newproject.d @@ -355,10 +355,10 @@ class NewProjectDlg : Dialog { ws.addProject(project); if (ws.startupProject is null) ws.startupProject = project; + string srcdir = buildNormalizedPath(pdir, "source"); + if (!exists(srcdir)) + mkdir(srcdir); if (!_currentTemplate.srcfile.empty && !_currentTemplate.srccode.empty) { - string srcdir = buildNormalizedPath(pdir, "source"); - if (!exists(srcdir)) - mkdir(srcdir); string srcfile = buildNormalizedPath(srcdir, _currentTemplate.srcfile); write(srcfile, _currentTemplate.srccode); }