Skip to content

Commit 0d51115

Browse files
authored
[Fix] Fix windows-style path in md2yml.py in Windows pre-commit. (open-mmlab#1407)
* test * avoid windows path
1 parent 98984bf commit 0d51115

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.dev/md2yml.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,12 @@ def update_model_index():
264264
yml_files = glob.glob(osp.join(configs_dir, '**', '*.yml'), recursive=True)
265265
yml_files.sort()
266266

267+
# add .replace('\\', '/') to avoid Windows Style path
267268
model_index = {
268-
'Import':
269-
[osp.relpath(yml_file, MMSEG_ROOT) for yml_file in yml_files]
269+
'Import': [
270+
osp.relpath(yml_file, MMSEG_ROOT).replace('\\', '/')
271+
for yml_file in yml_files
272+
]
270273
}
271274
model_index_file = osp.join(MMSEG_ROOT, 'model-index.yml')
272275
is_different = dump_yaml_and_check_difference(model_index,

0 commit comments

Comments
 (0)