[nostalgia/tools/pack] Add Bullock integration and cleanup FS access

This commit is contained in:
2023-02-01 22:41:04 -06:00
parent 1cc3549d00
commit fad8837ad1
3 changed files with 15 additions and 4 deletions
+11 -1
View File
@@ -6,6 +6,7 @@
#include <ox/clargs/clargs.hpp>
#include <ox/fs/fs.hpp>
#include <ox/logconn/logconn.hpp>
#include <nostalgia/core/typestore.hpp>
@@ -42,7 +43,6 @@ static ox::Result<ox::Buffer> readFileBuff(ox::CRStringView path) noexcept {
}
static ox::Error run(const ox::ClArgs &args) noexcept {
ox::trace::init();
const auto argSrc = args.getString("src", "");
const auto argRomBin = args.getString("rom-bin", "");
if (argSrc == "") {
@@ -78,6 +78,16 @@ static ox::Error run(const ox::ClArgs &args) noexcept {
}
int main(int argc, const char **args) {
ox::trace::init();
#ifdef DEBUG
ox::LoggerConn loggerConn;
const auto loggerErr = loggerConn.initConn("nost-pack");
if (loggerErr) {
oxErrf("Could not connect to logger: {} ({}:{})\n", toStr(loggerErr), loggerErr.file, loggerErr.line);
} else {
ox::trace::setLogger(&loggerConn);
}
#endif
const auto err = run(ox::ClArgs(argc, args));
oxAssert(err, "pack failed");
return static_cast<int>(err);