From 47982114afbd856546c026fd07ba8aa8b708fd1e Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Tue, 24 Mar 2015 19:33:31 -0400 Subject: [PATCH] Only makes output directory once --- src/Importer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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;