Skip to content

Commit 2d0b977

Browse files
mcpatepradyunsg
authored andcommitted
Write a digest for get-pip.py
1 parent b15acd8 commit 2d0b977

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/generate.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ def generate_one(variant, mapping, *, console, pip_versions):
279279
with get_pip.open("w", newline=newline) as f:
280280
f.write(rendered_template)
281281

282+
# Write a digest of the script to the correct location
283+
digest = destination / "get-pip.py.sha256"
284+
console.log(f" Writing [blue]{digest}")
285+
with digest.open("w", newline=newline) as f:
286+
f.write(hashlib.sha256(rendered_template.encode("utf-8")).hexdigest())
287+
282288

283289
def generate_moved(destination: str, *, location: str, console: Console):
284290
template = Path("templates") / "moved.py"

0 commit comments

Comments
 (0)