Skip to content

Commit

Permalink
Fix bug with empty pypi host
Browse files Browse the repository at this point in the history
  • Loading branch information
mheden committed Jan 20, 2025
1 parent a8fceb0 commit 3dae1ec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions batify.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,13 @@ def git_version():
header = header.replace(
"{{requirements}}", " ".join('"%s"' % d for d in dependencies)
)
header = header.replace("{{pypi-host}}", f"--trusted-host={args.pypi_host}")
header = header.replace("{{pypi-url}}", f"--index-url={args.pypi_url}")
header = header.replace(
"{{pypi-host}}",
f"--trusted-host={args.pypi_host}" if args.pypi_host else "",
)
header = header.replace(
"{{pypi-url}}", f"--index-url={args.pypi_url}" if args.pypi_url else ""
)
header = header.replace("{{gitversion}}", git_version())
f.write(header)
f.write(scriptdata)

0 comments on commit 3dae1ec

Please sign in to comment.