Skip to content

Commit

Permalink
Fail on AddSingleFile error, add import log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita committed Sep 29, 2023
1 parent 973bf97 commit e8e4098
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Caprica/main_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ bool parseCommandLineArguments(int argc, char* argv[], caprica::CapricaJobManage
if (!vm["ignorecwd"].as<bool>()) {
conf::Papyrus::importDirectories.reserve(1);
conf::Papyrus::importDirectories.emplace_back(filesystem::current_path().string());
if (!conf::General::quietCompile) {
std::cout << "Adding current working directory to import list: " << conf::Papyrus::importDirectories[0]
<< std::endl;
}
}

if (vm.count("import")) {
Expand All @@ -498,6 +502,8 @@ bool parseCommandLineArguments(int argc, char* argv[], caprica::CapricaJobManage
return false;
}
conf::Papyrus::importDirectories.push_back(caprica::FSUtils::canonical(sd));
if (!conf::General::quietCompile)
std::cout << "Adding import directory: " << conf::Papyrus::importDirectories.back() << std::endl;
}
continue;
}
Expand All @@ -506,6 +512,8 @@ bool parseCommandLineArguments(int argc, char* argv[], caprica::CapricaJobManage
return false;
}
conf::Papyrus::importDirectories.push_back(caprica::FSUtils::canonical(d));
if (!conf::General::quietCompile)
std::cout << "Adding import directory: " << conf::Papyrus::importDirectories.back() << std::endl;
}
}

Expand Down Expand Up @@ -583,10 +591,8 @@ bool parseCommandLineArguments(int argc, char* argv[], caprica::CapricaJobManage
f.append(".psc");
}
auto oDir = baseOutputDir;
addSingleFile(std::move(f),
std::move(oDir),
jobManager,
caprica::papyrus::PapyrusCompilationNode::NodeType::PapyrusCompile);
if (!addSingleFile(f, oDir, jobManager, caprica::papyrus::PapyrusCompilationNode::NodeType::PapyrusCompile))
return false;
}
}
return true;
Expand Down Expand Up @@ -616,10 +622,8 @@ bool parseCommandLineArguments(int argc, char* argv[], caprica::CapricaJobManage
return false;
}
auto oDir = baseOutputDir;
addSingleFile(std::move(f),
std::move(oDir),
jobManager,
caprica::papyrus::PapyrusCompilationNode::NodeType::PapyrusCompile);
if (!addSingleFile(f, oDir, jobManager, caprica::papyrus::PapyrusCompilationNode::NodeType::PapyrusCompile))
return false;
}
}
} catch (const std::exception& ex) {
Expand Down

0 comments on commit e8e4098

Please sign in to comment.