2013-06-20 15:23:22 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
|
2013-09-27 02:21:27 +00:00
|
|
|
from lib.util import safe_mkdir, extract_zip, tempdir, download
|
2013-06-20 15:23:22 +00:00
|
|
|
|
|
|
|
|
2013-07-01 14:27:14 +00:00
|
|
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
2014-04-28 17:49:49 +00:00
|
|
|
FRAMEWORKS_URL = 'https://github.com/atom/atom-shell/releases/download/v0.11.10'
|
2013-06-20 15:23:22 +00:00
|
|
|
|
|
|
|
def main():
|
|
|
|
os.chdir(SOURCE_ROOT)
|
|
|
|
safe_mkdir('frameworks')
|
2014-01-21 00:25:33 +00:00
|
|
|
download_and_unzip('Mantle')
|
|
|
|
download_and_unzip('ReactiveCocoa')
|
|
|
|
download_and_unzip('Squirrel')
|
2013-06-20 15:23:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
def download_and_unzip(framework):
|
|
|
|
zip_path = download_framework(framework)
|
|
|
|
if zip_path:
|
|
|
|
extract_zip(zip_path, 'frameworks')
|
|
|
|
|
|
|
|
|
|
|
|
def download_framework(framework):
|
|
|
|
framework_path = os.path.join('frameworks', framework) + '.framework'
|
|
|
|
if os.path.exists(framework_path):
|
|
|
|
return
|
|
|
|
|
|
|
|
filename = framework + '.framework.zip'
|
|
|
|
url = FRAMEWORKS_URL + '/' + filename
|
|
|
|
download_dir = tempdir(prefix='atom-shell-')
|
|
|
|
path = os.path.join(download_dir, filename)
|
|
|
|
|
|
|
|
download('Download ' + framework, url, path)
|
|
|
|
return path
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|