Skip to content

Commit

Permalink
Update dank.resource-pack-builder.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SirDank committed Apr 27, 2024
1 parent 63e14a2 commit 6ac1f6c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dank.resource-pack-builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import json
import time
import hashlib
import requests
import zipfile
import shutil
Expand Down Expand Up @@ -186,8 +187,15 @@ def compress_to_zip():
zf.write(filepath, zip_path)
job_progress.update(overall_task, advance=1)

def save_sha1():

with open('dank.resource-pack.zip', 'rb') as file:
sha1_hash = hashlib.sha1(file.read()).hexdigest()
with open('sha1.txt', 'w') as file:
file.write(sha1_hash)

if __name__ == "__main__":

cls()
session = requests.Session()
os.chdir(os.path.dirname(os.path.realpath(__file__)))
Expand All @@ -205,3 +213,5 @@ def compress_to_zip():
cleanup()
print(clr(f"\n > Compressing to Zip...\n"))
compress_to_zip()
print(clr(f"\n > Saving SHA-1...\n"))
save_sha1()

0 comments on commit 6ac1f6c

Please sign in to comment.