Skip to content

Commit e9ba66e

Browse files
committed
Fix PyPI names in json when .git is missing
1 parent 9a523be commit e9ba66e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

circuitpython_build_tools/scripts/build_bundles.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def get_module_name(library_path):
6161
"""Figure out the module or package name and return it"""
6262
repo = subprocess.run('git remote get-url origin', shell=True, stdout=subprocess.PIPE, cwd=library_path)
6363
repo = repo.stdout.decode("utf-8", errors="ignore").strip().lower()
64-
module_name = repo[:-4].split("/")[-1].replace("_", "-")
64+
if repo[-4:] == ".git":
65+
repo = repo[:-4]
66+
module_name = repo.split("/")[-1].replace("_", "-")
6567
return module_name, repo
6668

6769
def get_bundle_requirements(directory, package_list):

0 commit comments

Comments
 (0)