Skip to content

Commit

Permalink
Create build.py
Browse files Browse the repository at this point in the history
Simple script to speed up the build process for creating automatic install scripts for dev/test purposes.
  • Loading branch information
TheRealLoneLee committed Sep 12, 2023
1 parent 5e0d59f commit 7286530
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os
import zipfile
import shutil
from tqdm import tqdm

# Check if the directory "builds" exists
if not os.path.exists("builds"):
os.makedirs("builds")

# Ask the user for the current version
version = input("Please enter the current version in the format 'v0.0.0': ")

# Define the .zip file name
zipfile_name = "Gilbert-" + version + ".zip"

# Create a ZipFile object
with zipfile.ZipFile(os.path.join("builds", zipfile_name), 'w') as zipf:
# List of files to add
files_to_add = ["./setup.py", "./initiate.sh"]

# Iterate over each file
for file in tqdm(files_to_add, desc="Zipping files", unit="file"):
# Check if the file exists
if os.path.exists(file):
# Add file to the .zip file
zipf.write(file)
else:
print(f"{file} does not exist in the current directory.")

0 comments on commit 7286530

Please sign in to comment.