This commit is contained in:
Hackerpilot 2014-02-01 13:39:44 -08:00
parent 5077cd49d3
commit 29e23122af
3 changed files with 13 additions and 12 deletions

@ -1 +1 @@
Subproject commit 552d0bbb074445979675ab9784baf8119c6e1f3e
Subproject commit 42762f8dcd2ca542d07e3fd5bc3ae0586fc7ea68

View File

@ -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.
*/
@ -66,16 +74,9 @@ struct ModuleCache
*/
static void addImportPaths(string[] paths)
{
foreach (path; paths)
{
if (!exists(path))
{
Log.error("Cannot cache modules in ", path, " because it does not exist");
continue;
}
importPaths ~= path;
}
foreach (path; paths)
string[] addedPaths = paths.filter!(a => existanceCheck(a)).array();
importPaths ~= addedPaths;
foreach (path; addedPaths)
{
foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth))
{

View File

@ -218,7 +218,7 @@ string[] loadConfiguredImportDirs()
return [];
Log.info("Loading configuration from ", configLocation);
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)