diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-31 10:04:28 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-08-01 17:58:11 +0200 |
commit | ed71beee3e3a2bbfcba24281ad9e28a0f6df4054 (patch) | |
tree | 60811333fc6a42f5aa315cc6fbadb3c671e28199 /src/buildtool/common/action.hpp | |
parent | 62fed0cf026e676297b7560d8ffaef77d3017ce4 (diff) | |
download | justbuild-ed71beee3e3a2bbfcba24281ad9e28a0f6df4054.tar.gz |
class Action: include field cwd
... for the working directory inside the action directory.
Diffstat (limited to 'src/buildtool/common/action.hpp')
-rw-r--r-- | src/buildtool/common/action.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<std::string> command, + std::string cwd, std::map<std::string, std::string> env_vars, std::optional<std::string> may_fail, bool no_cache, @@ -36,6 +37,7 @@ class Action { std::map<std::string, std::string> 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<std::string, std::string> 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<std::string, std::string> { return env_; @@ -98,6 +103,7 @@ class Action { private: ActionIdentifier id_{}; std::vector<std::string> command_{}; + std::string cwd_{}; std::map<std::string, std::string> env_{}; bool is_tree_{}; std::optional<std::string> may_fail_{}; |