Skip to content

Commit

Permalink
Update build.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Athlon007 committed Feb 16, 2020
1 parent eeea349 commit 7781898
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from zipfile import ZipFile
from array import array
import shutil
import math
print("=== Building the release... ===\n")

BASE_DIR = os.getcwd()
Expand All @@ -19,8 +20,17 @@ def make_zip(files, zipName):
print('Creating new zip: {0}'.format(zipName))
NEW_ZIP = ZipFile(BASE_DIR + "\\" + zipName, 'w', zipfile.ZIP_DEFLATED)

CURSOR_UP_ONE = '\x1b[1A'
ERASE_LINE = '\x1b[2K'

x = 1
for file in files:
NEW_ZIP.write(file)
a = x / len(files) * 100
print("Progress: " + str(int(math.ceil(a))) + "% (" + file + ")")
sys.stdout.write(CURSOR_UP_ONE)
sys.stdout.write(ERASE_LINE)
x += 1

NEW_ZIP.close()

Expand Down

0 comments on commit 7781898

Please sign in to comment.