Skip to content

Commit ea1d9d6

Browse files
committed
Update destination to be a directory
This will make writing additional files to the directory easier.
1 parent b18de5a commit ea1d9d6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

scripts/generate.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ def determine_destination(base: str, variant: str) -> Path:
217217
public.mkdir()
218218

219219
if variant == "default":
220-
return public / "get-pip.py"
220+
return public
221221

222-
retval = public / variant / "get-pip.py"
223-
if not retval.parent.exists():
224-
retval.parent.mkdir()
222+
retval = public / variant
223+
if not retval.exists():
224+
retval.mkdir()
225225

226226
return retval
227227

@@ -258,10 +258,13 @@ def generate_one(variant, mapping, *, console, pip_versions):
258258
wheel_version=mapping["wheel"],
259259
minimum_supported_version=mapping["minimum_supported_version"],
260260
)
261-
# Write the script to the correct location
261+
262262
destination = determine_destination("public", variant)
263-
console.log(f" Writing [blue]{destination}")
264-
with destination.open("w", newline=newline) as f:
263+
264+
# Write the script to the correct location
265+
get_pip = destination / "get-pip.py"
266+
console.log(f" Writing [blue]{get_pip}")
267+
with get_pip.open("w", newline=newline) as f:
265268
f.write(rendered_template)
266269

267270

0 commit comments

Comments
 (0)