From ed71beee3e3a2bbfcba24281ad9e28a0f6df4054 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 31 Jul 2024 10:04:28 +0200 Subject: class Action: include field cwd ... for the working directory inside the action directory. --- src/buildtool/common/action.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/buildtool/common/action.hpp') diff --git a/src/buildtool/common/action.hpp b/src/buildtool/common/action.hpp index e9d4581d..350a1d2b 100644 --- a/src/buildtool/common/action.hpp +++ b/src/buildtool/common/action.hpp @@ -29,6 +29,7 @@ class Action { Action(std::string action_id, std::vector command, + std::string cwd, std::map env_vars, std::optional may_fail, bool no_cache, @@ -36,6 +37,7 @@ class Action { std::map execution_properties) : id_{std::move(action_id)}, command_{std::move(command)}, + cwd_{std::move(cwd)}, env_{std::move(env_vars)}, may_fail_{std::move(may_fail)}, no_cache_{no_cache}, @@ -47,6 +49,7 @@ class Action { std::map env_vars) : Action(std::move(action_id), std::move(command), + "", std::move(env_vars), std::nullopt, false, @@ -64,6 +67,8 @@ class Action { return command_; } + [[nodiscard]] auto Cwd() const -> std::string { return cwd_; } + [[nodiscard]] auto Env() const& noexcept -> std::map { return env_; @@ -98,6 +103,7 @@ class Action { private: ActionIdentifier id_{}; std::vector command_{}; + std::string cwd_{}; std::map env_{}; bool is_tree_{}; std::optional may_fail_{}; -- cgit v1.2.3