From b27c2e3694fa91c5947787761e0d5411acc27414 Mon Sep 17 00:00:00 2001 From: MengzhangLI Date: Wed, 23 Mar 2022 20:55:02 +0800 Subject: [PATCH] [Fix] Fix windows-style path in `md2yml.py` in Windows pre-commit. (#1407) * test * avoid windows path --- .dev/md2yml.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.dev/md2yml.py b/.dev/md2yml.py index af7b8f2f73..0fa41dcc18 100755 --- a/.dev/md2yml.py +++ b/.dev/md2yml.py @@ -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,