24 lines
929 B
C++
24 lines
929 B
C++
#include "MetaCoreDelivery/MetaCoreBuildPipeline.h"
|
|
|
|
#include <filesystem>
|
|
#include <iostream>
|
|
#include <string_view>
|
|
|
|
int main(int argc, char* argv[]) {
|
|
if (argc != 6 || std::string_view(argv[1]) != "export" || std::string_view(argv[2]) != "--package" ||
|
|
std::string_view(argv[4]) != "--output") {
|
|
std::cerr << "Usage: MetaCoreDiagnosticsTool export --package <path> --output <archive.tar.gz>\n";
|
|
return 2;
|
|
}
|
|
const std::filesystem::path package = argv[3];
|
|
const std::filesystem::path output = argv[5];
|
|
MetaCore::MetaCoreBuildIssue issue;
|
|
if (!MetaCore::MetaCoreExportDiagnostics(package, output, &issue)) {
|
|
std::cerr << MetaCore::MetaCoreBuildErrorCodeName(issue.Code) << ": " << issue.Message
|
|
<< " path=" << issue.Path.generic_string() << '\n';
|
|
return 1;
|
|
}
|
|
std::cout << "diagnostics=" << output.generic_string() << '\n';
|
|
return 0;
|
|
}
|