File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ def source_repos(config, examples):
169169
170170 subprocess .call (["mbed-cli" , "import" , repo_info ['repo' ]])
171171
172- def clone_repos (config , examples ):
172+ def clone_repos (config , examples , retry = 3 ):
173173 """ Clones each of the repos associated with the specific examples name from the
174174 json config file. Note if there is already a clone of the repo then it will first
175175 be removed to ensure a clean, up to date cloning.
@@ -185,8 +185,11 @@ def clone_repos(config, examples):
185185 if os .path .exists (name ):
186186 print ("'%s' example directory already exists. Deleting..." % name )
187187 rmtree (name )
188-
189- subprocess .call ([repo_info ['type' ], "clone" , repo_info ['repo' ]])
188+ for i in range (0 , retry ):
189+ if subprocess .call ([repo_info ['type' ], "clone" , repo_info ['repo' ]]) == 0 :
190+ break
191+ else :
192+ print ("ERROR : unable to clone the repo {}" .format (name ))
190193
191194def deploy_repos (config , examples ):
192195 """ If the example directory exists as provided by the json config file,
You can’t perform that action at this time.
0 commit comments