@@ -316,9 +316,24 @@ def updateSTRepo():
316
316
f"{ rname } /{ bname } " ,
317
317
],
318
318
]
319
+ gitmodule_path = repo_path / ".gitmodules"
320
+ if gitmodule_path .exists ():
321
+ git_cmds += (
322
+ [
323
+ "git" ,
324
+ "-C" ,
325
+ repo_path ,
326
+ "submodule" ,
327
+ "update" ,
328
+ "--init" ,
329
+ "--recursive" ,
330
+ ],
331
+ )
319
332
else :
320
333
# Clone it as it does not exists yet
321
- git_cmds = [["git" , "-C" , repo_local_path , "clone" , gh_STM32Cube ]]
334
+ git_cmds = [
335
+ ["git" , "-C" , repo_local_path , "clone" , "--recursive" , gh_STM32Cube ]
336
+ ]
322
337
for cmd in git_cmds :
323
338
execute_cmd (cmd , None )
324
339
latestTag (serie , repo_name , repo_path )
@@ -336,7 +351,10 @@ def latestTag(serie, repo_name, repo_path):
336
351
version_tag = execute_cmd (
337
352
["git" , "-C" , repo_path , "describe" , "--tags" , sha1_id ], None
338
353
)
339
- execute_cmd (["git" , "-C" , repo_path , "checkout" , version_tag ], subprocess .DEVNULL )
354
+ execute_cmd (
355
+ ["git" , "-C" , repo_path , "checkout" , "-f" , "--recurse-submodules" , version_tag ],
356
+ subprocess .DEVNULL ,
357
+ )
340
358
cube_versions [serie ] = version_tag
341
359
# print(f"Latest tagged version available for {repo_name} is {version_tag}")
342
360
0 commit comments