Skip to content

Commit 98a2e61

Browse files
committed
Fix '--offline' implementation to take into account multiple SCMs
1 parent 15774e3 commit 98a2e61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mbed/mbed.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ def clone(self, url, path, rev=None, depth=None, protocol=None, offline=False, *
12211221
# Main clone routine if the clone with cache ref failed (might occur if cache ref is dirty)
12221222
if main:
12231223
if offline:
1224-
error("Unable to clone repository \"%s\" in offline mode ('--offline' used)." % url)
1224+
continue
12251225
try:
12261226
scm.clone(url, path, depth=depth, protocol=protocol, **kwargs)
12271227
except ProcessException:
@@ -1236,6 +1236,11 @@ def clone(self, url, path, rev=None, depth=None, protocol=None, offline=False, *
12361236
self.set_cache(url)
12371237
return True
12381238

1239+
if offline:
1240+
error("Unable to clone repository \"%s\" in offline mode ('--offline' used)." % url)
1241+
if os.path.isdir(path):
1242+
rmtree_readonly(path)
1243+
12391244
return False
12401245

12411246
def getlibs(self):

0 commit comments

Comments
 (0)