2023-06-20 04:33:09 +00:00
|
|
|
#include "StarFile.hpp"
|
|
|
|
#include "StarVersioningDatabase.hpp"
|
|
|
|
|
|
|
|
using namespace Star;
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
try {
|
|
|
|
if (argc != 3) {
|
2023-06-27 10:23:44 +00:00
|
|
|
coutf("Usage, {} <versioned_json_json> <versioned_json_binary>\n", argv[0]);
|
2023-06-20 04:33:09 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto versionedJson = VersionedJson::fromJson(Json::parse(File::readFileString(argv[1])));
|
|
|
|
VersionedJson::writeFile(versionedJson, argv[2]);
|
|
|
|
return 0;
|
|
|
|
} catch (std::exception const& e) {
|
2023-06-27 10:23:44 +00:00
|
|
|
coutf("Error! Caught exception {}\n", outputException(e, true));
|
2023-06-20 04:33:09 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|