Skip to content

Commit

Permalink
Fix generate_submodule_cgmanifest.py Windows issues. (microsoft#6404)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgchen1 authored Jan 22, 2021
1 parent 60c772e commit 61ecf52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cgmanifests/submodules/generate_submodule_cgmanifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@
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,
Expand All @@ -82,7 +85,8 @@
"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)
Expand Down

0 comments on commit 61ecf52

Please sign in to comment.