Skip to content

Commit 75ccfe5

Browse files
committed
fix(reference): better message when reference not found
1 parent c7f782c commit 75ccfe5

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/ymp/stage/reference.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,15 @@ def __init__(self, *args):
228228
if not isinstance(matchlist, Sequence) or isinstance(matchlist, str):
229229
raise YmpConfigError(self.cfg, "Path 'match' must be list", key="match")
230230
self.reference.dir = self.local_path
231+
self.dir = self.local_path.rstrip("/")
232+
self.files = {}
231233
try:
232234
filenames = os.listdir(self.local_path)
233235
except FileNotFoundError:
234-
raise YmpConfigError(
235-
self.cfg,
236-
f"Directory '{self.local_path}' required by path resource inaccessible",
237-
)
238-
self.dir = self.local_path.rstrip("/")
236+
log.error(f"Directory '{self.local_path}' required by path resource inaccessible")
237+
self.files = {}
238+
return
239239

240-
self.files = {}
241240
for num, regex in enumerate(matchlist):
242241
try:
243242
comp_regex = re.compile(regex)
@@ -365,7 +364,7 @@ def outputs(self) -> Union[Set[str], Dict[str, str]]:
365364
self._outputs["/" + fname] = target
366365
else:
367366
normname = "/" + re.sub(
368-
f"(^|.)({'|'.join(keys)})\.", r"\1{sample}.", fname
367+
f"(^|.)({'|'.join(keys)})\\.", r"\1{sample}.", fname
369368
)
370369
self._outputs[normname] = ""
371370
return self._outputs

0 commit comments

Comments
 (0)