Normalize portable file times and explicit export base aliases (by Codex)
This commit is contained in:
1 parent
31bcf93205
commit
246e63a550
2 files changed
+6
-2
No files matched your search
@@ -210,7 +210,7 @@ void DemoFiles::validate(const Json &data) const {
|
||||
DemoFileEntry DemoFiles::decode(const fs::path &file, const std::string &raw) const {
|
||||
DemoFileEntry row;
|
||||
row.id = editor::utf8(file.filename()); row.token = content::sha256(raw); row.bytes = raw.size();
|
||||
row.modified = stamp(std::chrono::file_clock::to_sys(fs::last_write_time(file)));
|
||||
row.modified = stamp(std::chrono::time_point_cast<std::chrono::system_clock::duration>(std::chrono::file_clock::to_sys(fs::last_write_time(file))));
|
||||
const auto value = Json::parse(raw);
|
||||
if (value.value("schema", "") == "openbmh-ui-file@1") {
|
||||
const auto expected_kind = kind_ == DemoFileKind::career ? "career" : "desktop";
|
||||
@@ -316,7 +316,7 @@ DemoFileEntry DemoFiles::import_file(const fs::path &file) {
|
||||
void DemoFiles::export_file(const std::string &id, const std::string &expected, const fs::path &destination, bool overwrite) const {
|
||||
const auto entry = read(id, expected);
|
||||
validate_export_destination(root_, destination);
|
||||
safe_directory(destination.has_parent_path() ? destination.parent_path() : fs::path("."));
|
||||
safe_directory(fs::weakly_canonical(destination.has_parent_path() ? destination.parent_path() : fs::path(".")));
|
||||
const Json envelope = {{"schema", "openbmh-ui-file@1"}, {"kind", kind_ == DemoFileKind::career ? "career" : "desktop"},
|
||||
{"name", entry.name}, {"created", entry.created}, {"world", world_ ? world_->manifest().value("id", "") : ""},
|
||||
{"world_revision", world_ ? content::sha256(world_->manifest().dump()) : ""}, {"data", entry.data},
|
||||
|
||||
Reference in new issue
Block a user