diff --git a/CHANGES.d/20241107_141439_ph_run_with_env.md b/CHANGES.d/20241107_141439_ph_run_with_env.md new file mode 100644 index 0000000..83f24fe --- /dev/null +++ b/CHANGES.d/20241107_141439_ph_run_with_env.md @@ -0,0 +1 @@ +- add an env argument for the `Run` component to support running commands with specific environment variables diff --git a/src/batou_ext/run.py b/src/batou_ext/run.py index 3bd0069..8b8633c 100644 --- a/src/batou_ext/run.py +++ b/src/batou_ext/run.py @@ -31,6 +31,7 @@ class Run(batou.component.Component): namevar = "command" content = None file = None + env = None def configure(self): @@ -55,5 +56,5 @@ def verify(self): def update(self): self.touch(self.command_file.path) - self.cmd(self.command_file.path) + self.cmd(self.command_file.path, env=self.env) self.touch(f"{self.command_file.path}_stamp")