diff options
| author | Stefan Boberg <[email protected]> | 2021-11-17 14:56:22 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-11-17 14:56:22 +0100 |
| commit | 56d6eb7f6a044982b00893a13f8a31b53c7fb1eb (patch) | |
| tree | ce9770c73b64a63b12f1668a850bdd6317ea3fc1 | |
| parent | gc: fixed missing cidstore association (diff) | |
| download | zen-56d6eb7f6a044982b00893a13f8a31b53c7fb1eb.tar.xz zen-56d6eb7f6a044982b00893a13f8a31b53c7fb1eb.zip | |
zen: eliminated unused deploy command
| -rw-r--r-- | zen/cmds/deploy.cpp | 86 | ||||
| -rw-r--r-- | zen/cmds/deploy.h | 29 | ||||
| -rw-r--r-- | zen/zen.cpp | 3 | ||||
| -rw-r--r-- | zen/zen.vcxproj | 2 | ||||
| -rw-r--r-- | zen/zen.vcxproj.filters | 6 |
5 files changed, 0 insertions, 126 deletions
diff --git a/zen/cmds/deploy.cpp b/zen/cmds/deploy.cpp deleted file mode 100644 index d60392dd5..000000000 --- a/zen/cmds/deploy.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include "deploy.h" - -#include <zencore/logging.h> -#include <zencore/string.h> - -namespace zen { - -DeployCommand::DeployCommand() -{ - m_Options.add_options()("h,help", "Print help"); - m_Options.add_options()("no-clone", "Do not perform block clone", cxxopts::value(m_NoClone)->default_value("false")); - m_Options.add_options()("clean", - "Make clean deploy (i.e remove anything in target first)", - cxxopts::value(m_IsClean)->default_value("false")); - m_Options.add_option("", "s", "source", "Deploy source", cxxopts::value(m_CopySource), "<build store>"); - m_Options.add_option("", "t", "target", "Deploy target", cxxopts::value(m_CopyTarget), "<directory>"); - m_Options.add_option("", "", "positional", "Positional arguments", cxxopts::value(m_Positional), ""); -} - -DeployCommand::~DeployCommand() = default; - -int -DeployCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) -{ - ZEN_UNUSED(GlobalOptions); - - m_Options.parse_positional({"source", "target", "positional"}); - - auto result = m_Options.parse(argc, argv); - - if (result.count("help")) - { - std::cout << m_Options.help({"", "Group"}) << std::endl; - - return 0; - } - - // Validate arguments - - if (m_CopySource.empty()) - throw std::runtime_error("No source specified"); - - if (m_CopyTarget.empty()) - throw std::runtime_error("No target specified"); - - std::filesystem::path ToPath; - - ToPath = m_CopyTarget; - - const bool IsTargetDir = std::filesystem::is_directory(ToPath); - bool IsTargetNew = !std::filesystem::exists(ToPath); - - if (!IsTargetNew && !IsTargetDir) - { - throw std::runtime_error("Invalid target specification (needs to be a directory)"); - } - - zen::ExtendableStringBuilder<128> Path8; - zen::WideToUtf8(ToPath.c_str(), Path8); - - if (IsTargetNew == false && m_IsClean) - { - ZEN_INFO("Clean deploy -- deleting directory {}", Path8.c_str()); - - std::filesystem::remove_all(ToPath); - - IsTargetNew = true; // Create fresh new directory - } - - if (IsTargetNew) - { - ZEN_INFO("Creating directory {}", Path8.c_str()); - - std::filesystem::create_directories(ToPath); - } - - ZEN_INFO("Starting deploy operation..."); - - // TODO: implement! - - return 0; -} - -} // namespace zen diff --git a/zen/cmds/deploy.h b/zen/cmds/deploy.h deleted file mode 100644 index 975caf9e9..000000000 --- a/zen/cmds/deploy.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#pragma once - -#include "../zen.h" - -namespace zen { - -/** Deploy files from Zen build store - */ -class DeployCommand : public ZenCmdBase -{ -public: - DeployCommand(); - ~DeployCommand(); - - virtual cxxopts::Options* Options() override { return &m_Options; } - virtual int Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override; - -private: - cxxopts::Options m_Options{"deploy", "Deploy cooked data"}; - std::vector<std::string> m_Positional; - std::string m_CopySource; - std::string m_CopyTarget; - bool m_NoClone = false; - bool m_IsClean = false; -}; - -} // namespace zen diff --git a/zen/zen.cpp b/zen/zen.cpp index 3c33ff5e0..f5088533f 100644 --- a/zen/zen.cpp +++ b/zen/zen.cpp @@ -7,7 +7,6 @@ #include "cmds/cache.h" #include "cmds/copy.h" #include "cmds/dedup.h" -#include "cmds/deploy.h" #include "cmds/hash.h" #include "cmds/print.h" #include "cmds/run.h" @@ -102,7 +101,6 @@ main(int argc, char** argv) HashCommand HashCmd; CopyCommand CopyCmd; DedupCommand DedupCmd; - DeployCommand DeployCmd; DropCommand DropCmd; ChunkCommand ChunkCmd; RunCommand RunCmd; @@ -127,7 +125,6 @@ main(int argc, char** argv) // clang-format off {"chunk", &ChunkCmd, "Perform chunking"}, {"copy", &CopyCmd, "Copy file(s)"}, - {"deploy", &DeployCmd, "Deploy data"}, {"dedup", &DedupCmd, "Dedup files"}, {"drop", &DropCmd, "Drop cache bucket(s)"}, {"hash", &HashCmd, "Compute file hashes"}, diff --git a/zen/zen.vcxproj b/zen/zen.vcxproj index f31c0bc17..717319de4 100644 --- a/zen/zen.vcxproj +++ b/zen/zen.vcxproj @@ -97,7 +97,6 @@ <ClCompile Include="cmds\cache.cpp" /> <ClCompile Include="cmds\copy.cpp" /> <ClCompile Include="cmds\dedup.cpp" /> - <ClCompile Include="cmds\deploy.cpp" /> <ClCompile Include="cmds\hash.cpp" /> <ClCompile Include="cmds\print.cpp" /> <ClCompile Include="cmds\run.cpp" /> @@ -113,7 +112,6 @@ <ClInclude Include="cmds\cache.h" /> <ClInclude Include="cmds\copy.h" /> <ClInclude Include="cmds\dedup.h" /> - <ClInclude Include="cmds\deploy.h" /> <ClInclude Include="cmds\hash.h" /> <ClInclude Include="cmds\print.h" /> <ClInclude Include="cmds\run.h" /> diff --git a/zen/zen.vcxproj.filters b/zen/zen.vcxproj.filters index d983b413c..79580286c 100644 --- a/zen/zen.vcxproj.filters +++ b/zen/zen.vcxproj.filters @@ -10,9 +10,6 @@ <ClCompile Include="cmds\dedup.cpp"> <Filter>cmds</Filter> </ClCompile> - <ClCompile Include="cmds\deploy.cpp"> - <Filter>cmds</Filter> - </ClCompile> <ClCompile Include="cmds\copy.cpp"> <Filter>cmds</Filter> </ClCompile> @@ -37,9 +34,6 @@ <ClInclude Include="cmds\hash.h"> <Filter>cmds</Filter> </ClInclude> - <ClInclude Include="cmds\deploy.h"> - <Filter>cmds</Filter> - </ClInclude> <ClInclude Include="cmds\dedup.h"> <Filter>cmds</Filter> </ClInclude> |