2017-02-21 22:13:41 +01:00
|
|
|
import os
|
|
|
|
import platform
|
2017-02-23 19:24:54 +01:00
|
|
|
import subprocess
|
2017-02-21 22:13:41 +01:00
|
|
|
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())
|
2017-02-21 22:13:41 +01:00
|
|
|
full_filename = os.path.join('dist', zipfilename)
|
2017-03-16 02:23:04 +01:00
|
|
|
executables = ['lbrynet-daemon', 'lbrynet-cli']
|
|
|
|
ext = '.exe' if platform.system() == 'Windows' else ''
|
2017-02-21 22:13:41 +01:00
|
|
|
with zipfile.ZipFile(full_filename, 'w') as myzip:
|
2017-03-16 02:23:04 +01:00
|
|
|
for executable in executables:
|
|
|
|
myzip.write(os.path.join('app', 'dist', executable + ext), executable + ext)
|
2017-02-21 22:13:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
def get_system_label():
|
|
|
|
system = platform.system()
|
|
|
|
if system == 'Darwin':
|
2017-03-03 04:43:34 +01:00
|
|
|
return 'macos'
|
2017-02-21 22:13:41 +01:00
|
|
|
else:
|
2017-03-03 04:43:34 +01:00
|
|
|
return system.lower()
|
2017-02-21 22:13:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|