Skip to content

Commit

Permalink
yarn: remove unused registry_server_for_scope function
Browse files Browse the repository at this point in the history
There's no need for Cachi2 to directly access the contents of the
"npmRegistryServer" yarn_rc variable, since Yarn itself will read it
when we execute "yarn install". The code refering to it is a leftover of
the development phase.

Signed-off-by: Bruno Pimentel <bpimente@redhat.com>
  • Loading branch information
brunoapimentel committed Jan 10, 2025
1 parent e0201ea commit 7557f2c
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions cachi2/core/package_managers/yarn/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@ def __init__(self, path: RootedPath, data: dict[str, Any]) -> None:
self._path = path
super().__init__(data)

def registry_server_for_scope(self, scope: str) -> str:
"""Get the configured registry server for a scoped package.
Fallback to the global defined registry server if there's no configuration for this specific
scope.
See: https://v3.yarnpkg.com/configuration/yarnrc#npmScopes
"""
registry = self.data.get("npmScopes", {}).get(scope, {}).get("npmRegistryServer")
return registry or self["npmRegistryServer"]

def write(self) -> None:
"""Write the data to the yarnrc file."""
with self._path.path.open("w") as f:
Expand Down

0 comments on commit 7557f2c

Please sign in to comment.