else
{
builder.get_logger().log("files", format("Reading imports from %s", path.str()));
-
- list<string> dir_files = list_files(FS::dirname(path));
IO::File in(path.str());
DataFile::Parser parser(in, path.str());
+
+ list<string> dir_files;
while(!in.eof())
{
DataFile::Statement st = parser.parse();
if(st.keyword=="for_each")
{
+ // There's bound to be at least one file: the transform itself
+ if(dir_files.empty())
+ {
+ FS::Path dir = FS::dirname(path);
+ builder.get_logger().log("files", format("Traversing %s", dir.str()));
+ dir_files = list_files(dir);
+ }
+
for(DataFile::Statement::Arguments::const_iterator i=st.args.begin(); i!=st.args.end(); ++i)
{
Regex re(i->get<string>());