dragonfly/tools/zip_source.py
Jacob Schmidt bf951fd1f6
Some checks failed
Build / Build (push) Failing after 39s
Initial Repo Setup
2025-01-01 09:33:04 -06:00

34 lines
945 B
Python

import os
from zipfile import ZipFile, ZIP_LZMA
def createReleasePath():
dirName = '../x/dragonfly-client/release'
if not os.path.exists(dirName):
os.makedirs(dirName)
print('Directory ', dirName, ' created.')
else:
print('Directory ', dirName, ' already exists!')
def getAllFilePaths(dirName):
filePaths = []
for root, directories, files in os.walk(dirName):
for fileName in files:
filePath = os.path.join(root, fileName)
filePaths.append(filePath)
return filePaths
def main():
dirName = '../dragonfly-client'
filePaths = getAllFilePaths(dirName)
print('The following files will be zipped:')
for fileName in filePaths:
print(fileName)
with ZipFile('../x/dragonfly-client/release/dragonfly-client.zip', 'w', compression=ZIP_LZMA) as zip:
for file in filePaths:
zip.write(file)
print('All files zipped successfully!')
if __name__ == "__main__":
createReleasePath()
main()