diff --git a/src/Importer.cpp b/src/Importer.cpp index 4bbf81d..90b9fbe 100644 --- a/src/Importer.cpp +++ b/src/Importer.cpp @@ -3,6 +3,12 @@ Importer::Importer(Parser* parserIn, std::vector includePaths, std::string outputNameIn) { //constructor outputName = outputNameIn; + + if (mkdir(("./" + outputName).c_str(), 0755)) { + std::cerr << "\n\n =====IMPORTER===== \n\n" << std::endl; + std::cerr << "Could not make directory " << outputName << std::endl; + } + parser = parserIn; this->includePaths = includePaths; ASTTransformer = new ASTTransformation(this); @@ -127,11 +133,6 @@ NodeTree* Importer::parseAndTrim(std::string fileName) { std::cout << "outputName " << outputName << std::endl; std::cout << "fileName " << fileName << std::endl; - if (mkdir(("./" + outputName).c_str(), 0755)) { - std::cerr << "\n\n =====IMPORTER===== \n\n" << std::endl; - std::cerr << "Could not make directory " << outputName << std::endl; - } - auto pathPieces = split(fileName, '/'); std::string outputFileName = outputName + "/" + pathPieces[pathPieces.size()-1] + "out"; std::cout << "outputFileName " << outputFileName << std::endl;