lbry-desktop/zip_daemon.py

29 lines
705 B
Python
Raw Normal View History

import os
import platform
2017-02-23 19:24:54 +01:00
import subprocess
import sys
import zipfile
def main():
2017-02-23 19:24:54 +01:00
tag = subprocess.check_output(['git', 'describe']).strip()
zipfilename = 'lbrynet-daemon-{}-{}.zip'.format(tag, get_system_label())
full_filename = os.path.join('dist', zipfilename)
executable = 'lbrynet-daemon'
if platform.system() == 'Windows':
executable += '.exe'
with zipfile.ZipFile(full_filename, 'w') as myzip:
myzip.write(os.path.join('app', 'dist', executable), executable)
def get_system_label():
system = platform.system()
if system == 'Darwin':
return 'macos'
else:
return system.lower()
if __name__ == '__main__':
sys.exit(main())