Fix #105
This commit is contained in:
parent
5077cd49d3
commit
29e23122af
2
dscanner
2
dscanner
|
@ -1 +1 @@
|
||||||
Subproject commit 552d0bbb074445979675ab9784baf8119c6e1f3e
|
Subproject commit 42762f8dcd2ca542d07e3fd5bc3ae0586fc7ea68
|
|
@ -46,6 +46,14 @@ struct CacheEntry
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool existanceCheck(A)(A path)
|
||||||
|
{
|
||||||
|
if (path.exists())
|
||||||
|
return true;
|
||||||
|
Log.error("Cannot cache modules in ", path, " because it does not exist");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caches pre-parsed module information.
|
* Caches pre-parsed module information.
|
||||||
*/
|
*/
|
||||||
|
@ -66,16 +74,9 @@ struct ModuleCache
|
||||||
*/
|
*/
|
||||||
static void addImportPaths(string[] paths)
|
static void addImportPaths(string[] paths)
|
||||||
{
|
{
|
||||||
foreach (path; paths)
|
string[] addedPaths = paths.filter!(a => existanceCheck(a)).array();
|
||||||
{
|
importPaths ~= addedPaths;
|
||||||
if (!exists(path))
|
foreach (path; addedPaths)
|
||||||
{
|
|
||||||
Log.error("Cannot cache modules in ", path, " because it does not exist");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
importPaths ~= path;
|
|
||||||
}
|
|
||||||
foreach (path; paths)
|
|
||||||
{
|
{
|
||||||
foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth))
|
foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth))
|
||||||
{
|
{
|
||||||
|
|
2
server.d
2
server.d
|
@ -218,7 +218,7 @@ string[] loadConfiguredImportDirs()
|
||||||
return [];
|
return [];
|
||||||
Log.info("Loading configuration from ", configLocation);
|
Log.info("Loading configuration from ", configLocation);
|
||||||
File f = File(configLocation, "rt");
|
File f = File(configLocation, "rt");
|
||||||
return f.byLine(KeepTerminator.no).map!(a => a.idup).filter!(a => a.exists()).array();
|
return f.byLine(KeepTerminator.no).map!(a => a.idup).filter!(a => existanceCheck(a)).array();
|
||||||
}
|
}
|
||||||
|
|
||||||
void printHelp(string programName)
|
void printHelp(string programName)
|
||||||
|
|
Loading…
Reference in New Issue