Skip to content

Commit b15acd8

Browse files
mcpatepradyunsg
authored andcommitted
Update destination to be a directory
This will make writing additional files to the directory easier.
1 parent a7083ed commit b15acd8

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
@@ -229,11 +229,11 @@ def determine_destination(base: str, variant: str) -> Path:
229229
public.mkdir()
230230

231231
if variant == "default":
232-
return public / "get-pip.py"
232+
return public
233233

234-
retval = public / variant / "get-pip.py"
235-
if not retval.parent.exists():
236-
retval.parent.mkdir()
234+
retval = public / variant
235+
if not retval.exists():
236+
retval.mkdir()
237237

238238
return retval
239239

@@ -270,10 +270,13 @@ def generate_one(variant, mapping, *, console, pip_versions):
270270
wheel_version=mapping["wheel"],
271271
minimum_supported_version=mapping["minimum_supported_version"],
272272
)
273-
# Write the script to the correct location
273+
274274
destination = determine_destination("public", variant)
275-
console.log(f" Writing [blue]{destination}")
276-
with destination.open("w", newline=newline) as f:
275+
276+
# Write the script to the correct location
277+
get_pip = destination / "get-pip.py"
278+
console.log(f" Writing [blue]{get_pip}")
279+
with get_pip.open("w", newline=newline) as f:
277280
f.write(rendered_template)
278281

279282

0 commit comments

Comments
 (0)