Skip to content

Commit

Permalink
Fix devkit making duplicate entries to .nkh files
Browse files Browse the repository at this point in the history
  • Loading branch information
DisabledMallis committed Oct 20, 2022
1 parent 06720b6 commit e3ae6fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion DevKit/Features/Package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using namespace Common;
using namespace Common::Files;
using namespace Common::Logging;
using namespace Common::Logging::Logger;
using namespace Common::Util;
using namespace Common::Util::Json;
using namespace DevKit;
Expand Down Expand Up @@ -229,8 +230,13 @@ void Package::Run(std::vector<std::string> args)

if (modFmt == ModFmt::NKH) {
printf("Creating NKH package...\n");
fs::path resultPath = modName + ".nkh";
if (fs::exists(resultPath)) {
Print("Deleting existing .nkh file...");
fs::remove(resultPath);
}
ModArchive modFile;
if (!modFile.OpenWrite(modName + ".nkh")) {
if (!modFile.OpenWrite(resultPath)) {
printf("Failed to open archive to unpack\n");
return;
}
Expand Down

0 comments on commit e3ae6fa

Please sign in to comment.