Skip to content

Commit

Permalink
[Fix] Fix windows-style path in md2yml.py in Windows pre-commit. (o…
Browse files Browse the repository at this point in the history
…pen-mmlab#1407)

* test

* avoid windows path
  • Loading branch information
MengzhangLI authored and mob5566 committed Apr 13, 2022
1 parent d9fc6c0 commit ef106a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .dev/md2yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,12 @@ def update_model_index():
yml_files = glob.glob(osp.join(configs_dir, '**', '*.yml'), recursive=True)
yml_files.sort()

# add .replace('\\', '/') to avoid Windows Style path
model_index = {
'Import':
[osp.relpath(yml_file, MMSEG_ROOT) for yml_file in yml_files]
'Import': [
osp.relpath(yml_file, MMSEG_ROOT).replace('\\', '/')
for yml_file in yml_files
]
}
model_index_file = osp.join(MMSEG_ROOT, 'model-index.yml')
is_different = dump_yaml_and_check_difference(model_index,
Expand Down

0 comments on commit ef106a1

Please sign in to comment.