diff --git a/source/dub/dub.d b/source/dub/dub.d index 8dd3f3e..cbd9443 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -367,7 +367,9 @@ try { logTrace("writeDubJson"); - auto dstFile = openFile((m_root~".dub/dub.json").toString(), FileMode.CreateTrunc); + auto dubpath = m_root~".dub"; + if( !exists(dubpath.toNativeString()) ) mkdir(dubpath.toNativeString()); + auto dstFile = openFile((dubpath~"dub.json").toString(), FileMode.CreateTrunc); scope(exit) dstFile.close(); Appender!string js; toPrettyJson(js, m_json);