summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkhoden <[email protected]>2024-02-28 08:17:10 +0300
committerkhoden <[email protected]>2024-02-28 08:31:02 +0300
commit5aa6052b9b931b6b67de25ea29958667f4402f4f (patch)
treeede089de96213ce03566c17b37be1633778aad07
parent1643d01cc9831b0af32569503bb701848310d2d0 (diff)
nots/bootstrap: добавить параметр для очистки CAS
bc5f65939283a67efed802b5e7b2dda6cf645178
-rw-r--r--build/plugins/lib/nots/package_manager/pnpm/package_manager.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/build/plugins/lib/nots/package_manager/pnpm/package_manager.py b/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
index 00151f4f51b..21bf5e05785 100644
--- a/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
+++ b/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
@@ -2,7 +2,7 @@ import os
import shutil
from .lockfile import PnpmLockfile
-from .utils import build_pre_lockfile_path, build_lockfile_path, build_ws_config_path
+from .utils import build_lockfile_path, build_pre_lockfile_path, build_ws_config_path
from .workspace import PnpmWorkspace
from ..base import BasePackageManager, PackageManagerError
from ..base.constants import NODE_MODULES_WORKSPACE_BUNDLE_FILENAME
@@ -33,6 +33,10 @@ class PnpmPackageManager(BasePackageManager):
"""
return cls.load_lockfile(build_lockfile_path(dir_path))
+ @staticmethod
+ def get_local_pnpm_store():
+ return os.path.join(home_dir(), ".cache", "pnpm-store")
+
def create_node_modules(self, yatool_prebuilder_path=None, local_cli=False):
"""
Creates node_modules directory according to the lockfile.
@@ -46,7 +50,7 @@ class PnpmPackageManager(BasePackageManager):
# Local mode optimizations (run from the `ya tool nots`)
if local_cli:
# Use single CAS for all the projects built locally
- store_dir = os.path.join(home_dir(), ".cache", "pnpm-store")
+ store_dir = self.get_local_pnpm_store()
# It's a default value of pnpm itself. But it should be defined explicitly for not using values from the lockfiles or from the previous installations.
virtual_store_dir = self._nm_path('.pnpm')