From ae0048ef3d03c1511f2e12e0fdb5ae8d28061dab Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 2 Apr 2023 12:46:44 +0200 Subject: Add command to clone the source repository --- src/command.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/command.h') diff --git a/src/command.h b/src/command.h index 8d0679d..f03281f 100644 --- a/src/command.h +++ b/src/command.h @@ -3,6 +3,8 @@ #include #include #include "package.h" +#include +#include namespace katja { @@ -24,6 +26,29 @@ namespace katja void execute() const override; }; + class update final : public command + { + boost::filesystem::path git_binary; + + template + void git(const std::string& command, const std::filesystem::path& cwd, const Args&... args) const + { + if (cwd.empty()) + { + boost::process::system(git_binary, command, args...); + } + else + { + boost::process::system(git_binary, "-C", cwd.native(), command, args...); + } + } + + public: + explicit update(); + + void execute() const override; + }; + enum class command_exception_t { no_command, -- cgit v1.2.3