From 77ac5c33ca9103b1f836f37e0bbc835743f90d3f Mon Sep 17 00:00:00 2001 From: "Joey Vagedes (from Dev Box)" Date: Thu, 11 Jan 2024 08:01:05 -0800 Subject: [PATCH] Updates Added `sort` command to the VsWhere command Added typing hint for return of FindAllWithVsWhere --- edk2toollib/windows/locate_tools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/edk2toollib/windows/locate_tools.py b/edk2toollib/windows/locate_tools.py index a0d0f25b..cf897fc6 100644 --- a/edk2toollib/windows/locate_tools.py +++ b/edk2toollib/windows/locate_tools.py @@ -26,6 +26,7 @@ import re import subprocess from pathlib import Path +from typing import List, Optional import pkg_resources @@ -133,7 +134,7 @@ def FindWithVsWhere(products: str = "*", vs_version: str = None): Args: products (:obj:`str`, optional): product defined by vswhere tool - vs_version (:obj:`str, optional): helper to find version of supported VS version (example vs2019) + vs_version (:obj:`str`, optional): helper to find version of supported VS version (example vs2019) Returns: (str): VsWhere products @@ -146,7 +147,7 @@ def FindWithVsWhere(products: str = "*", vs_version: str = None): results = FindAllWithVsWhere(products, vs_version) return results[0] if results else None -def FindAllWithVsWhere(products: str = "*", vs_version: str = None): +def FindAllWithVsWhere(products: str = "*", vs_version: str = None) -> Optional[List[str]]: """Finds a product with VS Where. Returns all matches, sorted by newest version. Args: