Skip to content

Commit 7429645

Browse files
authored
Merge pull request #3918 from branfosj/20250910122843_new_pr_cmdcp
resolve templates in `CmdCp`
2 parents 59fa0db + 0f8cb4a commit 7429645

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

easybuild/easyblocks/generic/cmdcp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def build_step(self):
6767
# determine command to use
6868
# find (first) regex match, then complete matching command template
6969
cmd = None
70-
for pattern, regex_cmd in self.cfg['cmds_map']:
70+
for pattern, regex_cmd in self.cfg.get_ref('cmds_map'):
71+
pattern = pattern % self.cfg.template_values
72+
regex_cmd = regex_cmd % self.cfg.template_values
7173
try:
7274
regex = re.compile(pattern)
7375
except re.error as err:
@@ -78,6 +80,6 @@ def build_step(self):
7880
break
7981
if cmd is None:
8082
raise EasyBuildError("No match for %s in %s, don't know which command to use.",
81-
src, self.cfg['cmds_map'])
83+
src, self.cfg.get_ref('cmds_map'))
8284

8385
run_shell_cmd(cmd)

0 commit comments

Comments
 (0)