aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzousar <[email protected]>2025-04-02 12:16:02 -0600
committerzousar <[email protected]>2025-04-02 12:16:02 -0600
commit75f753cc70d4d87138944aa0b2d0d843d47caf5e (patch)
tree3367173eb17a123889b75d4091168bd3bc985b32 /src
parentMerge branch 'main' of https://github.ol.epicgames.net/ue-foundation/zen (diff)
parent5.6.2-pre0 (diff)
downloadzen-75f753cc70d4d87138944aa0b2d0d843d47caf5e.tar.xz
zen-75f753cc70d4d87138944aa0b2d0d843d47caf5e.zip
Merge branch 'main' of https://github.ol.epicgames.net/ue-foundation/zen
Diffstat (limited to 'src')
-rw-r--r--src/zen/cmds/builds_cmd.cpp28
-rw-r--r--src/zencore/compactbinaryjson.cpp1
2 files changed, 18 insertions, 11 deletions
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp
index 8e8fd480a..ba2564fad 100644
--- a/src/zen/cmds/builds_cmd.cpp
+++ b/src/zen/cmds/builds_cmd.cpp
@@ -164,9 +164,9 @@ namespace {
);
- std::filesystem::path MakeSafeAbsolutePath(const std::string Path)
+ std::filesystem::path MakeSafeAbsolutePath(std::filesystem::path Path)
{
- std::filesystem::path AbsolutePath = std::filesystem::absolute(StringToPath(Path)).make_preferred();
+ std::filesystem::path AbsolutePath = std::filesystem::absolute(Path).make_preferred();
#if ZEN_PLATFORM_WINDOWS && 1
const std::string_view Prefix = "\\\\?\\";
const std::u8string PrefixU8(Prefix.begin(), Prefix.end());
@@ -180,6 +180,8 @@ namespace {
return AbsolutePath;
}
+ std::filesystem::path MakeSafeAbsolutePath(const std::string PathString) { return MakeSafeAbsolutePath(StringToPath(PathString)); }
+
void RenameFileWithRetry(const std::filesystem::path& SourcePath, const std::filesystem::path& TargetPath)
{
std::error_code Ec;
@@ -9061,8 +9063,9 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
BuildStorage::Statistics StorageStats;
BuildStorageCache::Statistics StorageCacheStats;
- const std::filesystem::path ZenFolderPath =
- m_ZenFolderPath.empty() ? MakeSafeAbsolutePath(".") / ZenFolderName : MakeSafeAbsolutePath(m_ZenFolderPath);
+ const std::filesystem::path ZenFolderPath = m_ZenFolderPath.empty()
+ ? MakeSafeAbsolutePath(std::filesystem::current_path()) / ZenFolderName
+ : MakeSafeAbsolutePath(m_ZenFolderPath);
CreateDirectories(ZenFolderPath);
auto _ = MakeGuard([ZenFolderPath]() {
if (CleanDirectory(ZenFolderPath, {}))
@@ -9176,8 +9179,9 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
BuildStorage::Statistics StorageStats;
BuildStorageCache::Statistics StorageCacheStats;
- const std::filesystem::path ZenFolderPath =
- m_ZenFolderPath.empty() ? MakeSafeAbsolutePath(".") / ZenFolderName : MakeSafeAbsolutePath(m_ZenFolderPath);
+ const std::filesystem::path ZenFolderPath = m_ZenFolderPath.empty()
+ ? MakeSafeAbsolutePath(std::filesystem::current_path()) / ZenFolderName
+ : MakeSafeAbsolutePath(m_ZenFolderPath);
CreateDirectories(ZenFolderPath);
auto _ = MakeGuard([ZenFolderPath]() {
if (CleanDirectory(ZenFolderPath, {}))
@@ -9227,7 +9231,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
m_BuildPartName,
Path,
ZenFolderPath,
- MakeSafeAbsolutePath(m_ManifestPath),
+ m_ManifestPath.empty() ? std::filesystem::path{} : MakeSafeAbsolutePath(m_ManifestPath),
m_FindBlockMaxCount,
m_BlockReuseMinPercentLimit,
m_AllowMultiparts,
@@ -9777,8 +9781,9 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
BuildStorage::Statistics StorageStats;
BuildStorageCache::Statistics StorageCacheStats;
- const std::filesystem::path ZenFolderPath =
- m_ZenFolderPath.empty() ? MakeSafeAbsolutePath(".") / ZenFolderName : MakeSafeAbsolutePath(m_ZenFolderPath);
+ const std::filesystem::path ZenFolderPath = m_ZenFolderPath.empty()
+ ? MakeSafeAbsolutePath(std::filesystem::current_path()) / ZenFolderName
+ : MakeSafeAbsolutePath(m_ZenFolderPath);
CreateDirectories(ZenFolderPath);
auto _ = MakeGuard([ZenFolderPath]() {
if (CleanDirectory(ZenFolderPath, {}))
@@ -9828,8 +9833,9 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
BuildStorage::Statistics StorageStats;
BuildStorageCache::Statistics StorageCacheStats;
- const std::filesystem::path ZenFolderPath =
- m_ZenFolderPath.empty() ? MakeSafeAbsolutePath(".") / ZenFolderName : MakeSafeAbsolutePath(m_ZenFolderPath);
+ const std::filesystem::path ZenFolderPath = m_ZenFolderPath.empty()
+ ? MakeSafeAbsolutePath(std::filesystem::current_path()) / ZenFolderName
+ : MakeSafeAbsolutePath(m_ZenFolderPath);
CreateDirectories(ZenFolderPath);
auto _ = MakeGuard([ZenFolderPath]() {
if (CleanDirectory(ZenFolderPath, {}))
diff --git a/src/zencore/compactbinaryjson.cpp b/src/zencore/compactbinaryjson.cpp
index d8c8a8584..68ed09549 100644
--- a/src/zencore/compactbinaryjson.cpp
+++ b/src/zencore/compactbinaryjson.cpp
@@ -293,6 +293,7 @@ private:
const uint32_t EncodedSize = Base64::GetEncodedDataSize(uint32_t(Value.GetSize()));
const size_t EncodedIndex = Builder.AddUninitialized(size_t(EncodedSize));
Base64::Encode(static_cast<const uint8_t*>(Value.GetData()), uint32_t(Value.GetSize()), Builder.Data() + EncodedIndex);
+ Builder << '"';
}
private: