Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

Commit

Permalink
More folder creation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Idhrendur committed Jan 24, 2017
1 parent 401cec7 commit 139df03
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Vic2ToHoI4/Source/HOI4World/HoI4Country.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void HoI4Country::output(const map<int, HoI4State*>& states, const vector<HoI4Fa
output.open("Output/" + Configuration::getOutputName() + "/history/countries/" + Utils::convertUTF8ToASCII(filename));
if (!output.is_open())
{
Log(LogLevel::Error) << "Could not open " << "Output/" << Configuration::getOutputName() << "/common/history/" << Utils::convertUTF8ToASCII(filename);
Log(LogLevel::Error) << "Could not open " << "Output/" << Configuration::getOutputName() << "/history/countries" << Utils::convertUTF8ToASCII(filename);
exit(-1);
}
output << "\xEF\xBB\xBF"; // add the BOM to make HoI4 happy
Expand Down
18 changes: 16 additions & 2 deletions Vic2ToHoI4/Source/HOI4World/HoI4World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,22 @@ void HoI4World::outputMap() const
void HoI4World::outputCountries() const
{
LOG(LogLevel::Debug) << "Writing countries";
string unitsPath = "Output/" + Configuration::getOutputName() + "/history/units";
if (!Utils::TryCreateFolder(unitsPath))
if (!Utils::TryCreateFolder("Output/" + Configuration::getOutputName() + "/history"))
{
LOG(LogLevel::Error) << "Could not create \"Output/" + Configuration::getOutputName() + "/history";
exit(-1);
}
if (!Utils::TryCreateFolder("Output/" + Configuration::getOutputName() + "/history/countries"))
{
LOG(LogLevel::Error) << "Could not create \"Output/" + Configuration::getOutputName() + "/history";
exit(-1);
}
if (!Utils::TryCreateFolder("Output/" + Configuration::getOutputName() + "/history/states"))
{
LOG(LogLevel::Error) << "Could not create \"Output/" + Configuration::getOutputName() + "/history/states";
exit(-1);
}
if (!Utils::TryCreateFolder("Output/" + Configuration::getOutputName() + "/history/units"))
{
LOG(LogLevel::Error) << "Could not create \"Output/" + Configuration::getOutputName() + "/history/units";
exit(-1);
Expand Down

0 comments on commit 139df03

Please sign in to comment.