Skip to content

Commit

Permalink
Update destination to be a directory
Browse files Browse the repository at this point in the history
This will make writing additional files to the directory easier.
  • Loading branch information
mcpate committed Mar 19, 2024
1 parent b18de5a commit ea1d9d6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions scripts/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ def determine_destination(base: str, variant: str) -> Path:
public.mkdir()

if variant == "default":
return public / "get-pip.py"
return public

retval = public / variant / "get-pip.py"
if not retval.parent.exists():
retval.parent.mkdir()
retval = public / variant
if not retval.exists():
retval.mkdir()

return retval

Expand Down Expand Up @@ -258,10 +258,13 @@ def generate_one(variant, mapping, *, console, pip_versions):
wheel_version=mapping["wheel"],
minimum_supported_version=mapping["minimum_supported_version"],
)
# Write the script to the correct location

destination = determine_destination("public", variant)
console.log(f" Writing [blue]{destination}")
with destination.open("w", newline=newline) as f:

# Write the script to the correct location
get_pip = destination / "get-pip.py"
console.log(f" Writing [blue]{get_pip}")
with get_pip.open("w", newline=newline) as f:
f.write(rendered_template)


Expand Down

0 comments on commit ea1d9d6

Please sign in to comment.