Fix generate_submodule_cgmanifest.py Windows issues. (#6404)

This commit is contained in:
Edward Chen 2021-01-22 12:25:55 -08:00 committed by GitHub
parent 60c772e2bc
commit 61ecf52c24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,10 +61,13 @@ with open(os.path.join(REPO_DIR, 'tools', 'ci_build', 'github', 'linux', 'docker
package_filename = None
package_url = None
def normalize_path_separators(path):
return path.replace(os.path.sep, "/")
proc = subprocess.run(
["git", "submodule", "foreach", "--quiet", "--recursive", "{} {} $toplevel/$sm_path".format(
sys.executable, os.path.join(SCRIPT_DIR, "print_submodule_info.py"))],
normalize_path_separators(sys.executable),
normalize_path_separators(os.path.join(SCRIPT_DIR, "print_submodule_info.py")))],
check=True,
cwd=REPO_DIR,
stdout=subprocess.PIPE,
@ -82,7 +85,8 @@ for submodule_line in submodule_lines:
"commitHash": commit,
"repositoryUrl": url,
},
"comments": "git submodule at {}".format(os.path.relpath(absolute_path, REPO_DIR))
"comments": "git submodule at {}".format(
normalize_path_separators(os.path.relpath(absolute_path, REPO_DIR)))
}
}
registrations.append(registration)