diff options
| author | Martin Ridgers <[email protected]> | 2021-12-15 08:58:20 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-12-15 08:58:20 +0100 |
| commit | 4fbc2f8ba15fb96bf46a82d109ad1953a26caec4 (patch) | |
| tree | 0fc1e286f3d1d937a884466c9ec8ace436c1d1cc | |
| parent | Resettled whitespace (diff) | |
| download | zen-4fbc2f8ba15fb96bf46a82d109ad1953a26caec4.tar.xz zen-4fbc2f8ba15fb96bf46a82d109ad1953a26caec4.zip | |
Deleted file that mysteriously returned via a merge
| -rw-r--r-- | zen/cmds/deploy.cpp | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/zen/cmds/deploy.cpp b/zen/cmds/deploy.cpp deleted file mode 100644 index 10808d063..000000000 --- a/zen/cmds/deploy.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include "deploy.h" - -#include <zencore/filesystem.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::PathToUtf8(ToPath, 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 |