diff options
Diffstat (limited to 'src/command.h')
| -rw-r--r-- | src/command.h | 25 |
1 files changed, 25 insertions, 0 deletions
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 <memory> #include <vector> #include "package.h" +#include <boost/process.hpp> +#include <filesystem> namespace katja { @@ -24,6 +26,29 @@ namespace katja void execute() const override; }; + class update final : public command + { + boost::filesystem::path git_binary; + + template<typename... Args> + 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, |
