Skip to content
Snippets Groups Projects
Commit 0f9004f3 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Introduce $MODULE_PATH usable in install step

parent ba3795f6
No related branches found
No related tags found
1 merge request!26Resolve "Local (non-sudo) CMake 21 setup"
......@@ -8,9 +8,6 @@ from armarx_setup.core.module.context import Hook
from armarx_setup.core.util import commands, environ_context as env_ctx
from armarx_setup import console
class CMake(Hook):
def install(self):
......@@ -28,10 +25,16 @@ class Env(Hook):
super().__init__(ctx=ctx)
self.env: Dict[str, str] = kwargs
for k, v in self.env.items():
for k in self.env:
v = self.env[k]
if not (isinstance(k, str) and isinstance(v, str)):
raise error.ArmarXSetupError(f"Invalid env entry: '{k}': '{v}'")
v = v.replace("$MODULE_PATH", self.ctx.path)
self.env[k] = v
def install(self):
for k, v in self.env.items():
self.ctx.module.ws.env_file.add(k, v, by=self.ctx.module.name, write=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment