File tree Expand file tree Collapse file tree
package_xml_validation/helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515import xml .etree .ElementTree as ET
1616from pathlib import Path
1717from typing import Dict , List
18+ import os
1819
1920
2021def find_package_dir (path : Path ) -> Path :
@@ -113,11 +114,16 @@ def get_pkgs_in_wrs(path: Path) -> List[str]:
113114 try :
114115 pkg_dir = find_package_dir (path )
115116 ws_root = find_workspace_root (pkg_dir )
116-
117- pkgs = pkg_iterator (ws_root / "src" )
117+ src_dir = ws_root / "src"
118118 except Exception as e :
119119 print (f"Exception extracting local pkgs: { e } " )
120- return []
120+ if pkg_dir and os .path .exists (pkg_dir .absolute ()):
121+ print (f"Attempting to extract local pkgs from { pkg_dir } " )
122+ src_dir = pkg_dir .parent
123+ else :
124+ print (f"Unable to extract local pkgs" )
125+ return []
126+ pkgs = pkg_iterator (src_dir )
121127 return sorted (pkgs )
122128
123129
You can’t perform that action at this time.
0 commit comments