From bc453d167fae57479efc7f0829057f5fe2544071 Mon Sep 17 00:00:00 2001 From: Nishanth Sanjeevi Date: Sun, 25 Feb 2024 06:38:37 +0530 Subject: [PATCH] Fix NuGet cache failures with custom paths (#761) The second strip("global-packages: ") call is intended to remove the characters in the set "global-packages: " from both ends of the string. This set includes each individual character: 'g', 'l', 'o', 'b', 'a', 'l', '-', 'p', 'a', 'c', 'k', 'a', 'g', 'e', 's', ':', and ' ' (space). It does not treat "global-packages: " as a single substring to remove. --- edk2toolext/environment/extdeptypes/nuget_dependency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edk2toolext/environment/extdeptypes/nuget_dependency.py b/edk2toolext/environment/extdeptypes/nuget_dependency.py index 092d4bae..ba312901 100644 --- a/edk2toolext/environment/extdeptypes/nuget_dependency.py +++ b/edk2toolext/environment/extdeptypes/nuget_dependency.py @@ -169,7 +169,7 @@ def _fetch_from_nuget_cache(self, package_name: str) -> bool: # Seek to the beginning of the output buffer and capture the output. return_buffer.seek(0) return_string = return_buffer.read() - self.nuget_cache_path = return_string.strip().strip("global-packages: ") + self.nuget_cache_path = return_string.strip().replace("global-packages: ", "") if self.nuget_cache_path is None: logging.info("Nuget was unable to provide global packages cache location.")