-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple script to speed up the build process for creating automatic install scripts for dev/test purposes.
- Loading branch information
1 parent
5e0d59f
commit 7286530
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") |