Skip to content

Commit 8c58228

Browse files
committed
Handle rm repo in external paths, fix test failure
1 parent 9ee797d commit 8c58228

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mlc/repo_action.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def find(self, run_args):
222222
matched_repo_path = repo_obj
223223
break
224224

225+
225226
# Search through self.repos for matching repos
226227
lst = []
227228
for i in self.repos:
@@ -539,8 +540,11 @@ def rm(self, run_args):
539540
repo_path = repo.path
540541

541542
else:
542-
if os.path.exists(run_args['repo']):
543-
repo_path = run_args['repo']
543+
repo = run_args['repo']
544+
if os.path.exists(repo):
545+
repo_path = repo
546+
elif os.path.isdir(os.path.join(self.repos_path, repo)):
547+
repo_path = os.path.join(self.repos_path, repo)
544548
else:
545549
return r
546550

0 commit comments

Comments
 (0)