You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
819 B
Python
23 lines
819 B
Python
10 months ago
|
import os
|
||
|
import zipfile
|
||
|
|
||
|
# Input directory containing the files
|
||
|
input_dir = "old_steam/"
|
||
|
zip_file_name = "old_steam"
|
||
|
|
||
|
# Output directory for generated header files
|
||
|
output_dir = "steam-rollback/resources/"
|
||
|
|
||
|
# Create the output directory if it doesn't exist
|
||
|
os.makedirs(output_dir, exist_ok=True)
|
||
|
|
||
10 months ago
|
with zipfile.ZipFile(output_dir + zip_file_name + ".zip", 'w') as zipf:
|
||
10 months ago
|
for root, _, filenames in os.walk(input_dir):
|
||
|
for filename in filenames:
|
||
|
file_path = os.path.join(root, filename) # Construct the full path
|
||
|
print(f"Adding file into zip: {file_path}")
|
||
|
zipf.write(file_path, os.path.relpath(file_path, input_dir)) # Add the file to the zip archive
|
||
|
|
||
10 months ago
|
print(f"All files added to the zip, generating file...")
|
||
10 months ago
|
|
||
10 months ago
|
print(f"Generated zip file: {output_dir + zip_file_name}.zip")
|