Skip to content

Commit

Permalink
Raise if alias was not registered when attempting to read alias direc…
Browse files Browse the repository at this point in the history
…tory
  • Loading branch information
HappyTetrahedron committed Jan 30, 2025
1 parent ff83124 commit ae47615
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commodore/component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def alias_directory(self, alias: str) -> P:
apath = self._dependency.get_component(alias)
if not apath:
raise ValueError(f"unknown alias {alias} for component {self.name}")
if alias in self._aliases:
return apath / self._aliases[alias][1]
return apath / self._sub_path
if alias not in self._aliases:
raise ValueError(f"alias {alias} for component {self.name} has not been registered")
return apath / self._aliases[alias][1]

def alias_class_file(self, alias: str) -> P:
return self.alias_directory(alias) / "class" / f"{self.name}.yml"
Expand Down

0 comments on commit ae47615

Please sign in to comment.