Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Issue #54 #81

Merged
merged 11 commits into from
Feb 13, 2025
4 changes: 1 addition & 3 deletions .github/workflows/test-mlc-core-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:

- name: Test 10 - rm cache - More than one cache present
run: |
mlc rm cache --tags=get,imagenet-aux 2>&1 --all | tee test7.log
mlc rm cache --tags=get,imagenet-aux -f

- name: Test 11 - cp script - Copy mlc script
run: |
Expand Down Expand Up @@ -193,5 +193,3 @@ jobs:
- name: Test 20 - list cache
run: |
mlc list cache


24 changes: 12 additions & 12 deletions mlc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,17 @@ def is_curdir_inside_path(base_path):
# Iterate through the list of repository paths
for repo_path in repo_paths:
if not os.path.exists(repo_path):
logger.warning(f"""Warning: {repo_path} not found. Consider doing `mlc rm repo {repo_path}`. Skipping...""")
logger.warning(f"""Warning: {repo_path} not found. Considering it as a corrupt entry and deleting automatically...""")
logger.warning(f"Deleting the {meta_yaml_path} entry from repos.json")
res = self.access(
{
"automation": "repo",
"action": "rm",
"repo": f"{os.path.basename(repo_path)}"
}
)
if res["return"] > 0:
return res
continue

if is_curdir_inside_path(repo_path):
Expand All @@ -157,17 +167,7 @@ def is_curdir_inside_path(base_path):

# Check if meta.yaml exists
if not os.path.isfile(meta_yaml_path):
logger.warning(f"{meta_yaml_path} not found. Skipping...")
logger.warning(f"Deleting the {meta_yaml_path} entry from repos.json")
res = self.access(
{
"automation": "repo",
"action": "rm",
"repo": f"{os.path.basename(repo_path)}"
}
)
if res["return"] > 0:
return res
logger.warning(f"{meta_yaml_path} not found. Could be due to accidental deletion of meta.yaml. Try to stash the changes or reclone by doing `rm repo` and `pull repo`. Skipping...")
continue

# Load the YAML file
Expand Down
Loading