4
4
import os
5
5
import subprocess
6
6
from get_remote_modules import get_remote_module
7
- from typing import TextIO , List , Tuple , Dict , Any
7
+ from typing import TextIO , List , Tuple , Dict , Any , cast , Union
8
+
8
9
9
10
def run_command (command : List [str ], ** kwargs : Dict [str , Any ]):
10
11
is_timeout = False
11
- p = subprocess .Popen (command , shell = False , stdout = subprocess .PIPE , stderr = subprocess .PIPE , ** kwargs )
12
+ p = subprocess .Popen (command , shell = False , stdout = subprocess .PIPE , stderr = subprocess .PIPE , ** kwargs ) # type: ignore
12
13
try :
13
14
stdout , stderr = p .communicate (timeout = 5 )
14
15
except subprocess .TimeoutExpired as e :
@@ -97,9 +98,12 @@ def handle_meta_modules(modules: List[Tuple[str,str]]) -> Tuple[List[Tuple[str,s
97
98
modules_to_modules_folder [module ] = module_folder
98
99
break
99
100
100
- if not found_local :
101
+ if not found_local and module :
101
102
# TODO: Handle update
102
- found_remote , module_folder = get_remote_module (module )
103
+ found_remote , module_folder_remote = get_remote_module (module )
104
+ if module_folder_remote is not None :
105
+ module_folder = module_folder_remote
106
+
103
107
modules_to_modules_folder [module ] = module_folder
104
108
105
109
@@ -112,7 +116,7 @@ def handle_meta_modules(modules: List[Tuple[str,str]]) -> Tuple[List[Tuple[str,s
112
116
# Meta module detected
113
117
print (f"Running: { meta_module_path } " )
114
118
print (f"ENV: { os .environ ['BASE_BOARD' ]} " )
115
- submodules , meta_module_errors , is_timeout = run_command (meta_module_path )
119
+ submodules , meta_module_errors , is_timeout = run_command ([ meta_module_path ] )
116
120
submodules = submodules .strip ()
117
121
print (f"Adding in modules: { submodules } " )
118
122
if meta_module_errors != "" or is_timeout :
0 commit comments