Skip to content

Commit

Permalink
fix nxlink and if | is present
Browse files Browse the repository at this point in the history
  • Loading branch information
PoloNX committed Jan 10, 2024
1 parent aa82770 commit b34e4ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions source/extract.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <iostream>
#include <fstream>
#include <filesystem>
#include <regex>

#include "extract.hpp"
#include "progress_event.hpp"
Expand Down Expand Up @@ -103,11 +104,17 @@ namespace extract {
if (std::string(entryName).find("romfs/") != std::string::npos || std::string(entryName).find("exefs/") != std::string::npos) {

std::string outputFilePath;


if (std::string(entryName).find("romfs/") != std::string::npos)
outputFilePath = outputDir + "/" + std::string(entryName).substr(std::string(entryName).find("romfs/") + 6);
else
outputFilePath = outputDir + "/" + std::string(entryName).substr(std::string(entryName).find("exefs/") + 6);

if (std::string(entryName).find("|") != std::string::npos)
outputFilePath = outputFilePath.substr(0, outputFilePath.find("|"));


std::cout << outputFilePath << std::endl;
std::filesystem::path outputPath(outputFilePath);
std::filesystem::create_directories(outputPath.parent_path());
Expand Down
4 changes: 2 additions & 2 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void init() {
setsysInitialize();
plInitialize(PlServiceType_User);
nsInitialize();
socketInitializeDefault();
nxlinkStdio();
//socketInitializeDefault();
//nxlinkStdio();
pmdmntInitialize();
pminfoInitialize();
splInitialize();
Expand Down
3 changes: 3 additions & 0 deletions source/mods_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ ModsPage::ModsPage(Mod &mod, Game& game, const std::string& search, const int& p
std::regex pattern(":");
std::string resultat = std::regex_replace(this->currentGame.title, pattern, " -");

pattern = std::regex("|");
resultat = std::regex_replace(this->currentGame.title, pattern, "");

extract::extractEntry(fmt::format("sdmc:/config/SimpleModDownloader/{}", i.name), fmt::format("sdmc:{}{}/{}/contents/{}/romfs",utils::getModInstallPath(),resultat, this->currentMod.title, this->currentGame.tid), this->currentGame.tid);
}));

Expand Down

0 comments on commit b34e4ef

Please sign in to comment.