3 # Download individual checksum files for Electron zip files from S3,
4 # concatenate them, and upload to GitHub.
6 from __future__ import print_function
11 from lib.config import s3_config
12 from lib.util import boto_path_dirs
14 sys.path.extend(boto_path_dirs())
15 from boto.s3.connection import S3Connection
21 bucket_name, access_key, secret_key = s3_config()
22 s3 = S3Connection(access_key, secret_key)
23 bucket = s3.get_bucket(bucket_name)
25 print('S3 bucket "{}" does not exist!'.format(bucket_name), file=sys.stderr)
28 prefix = 'atom-shell/tmp/{0}/'.format(args.version)
29 shasums = [s3_object.get_contents_as_string().strip()
30 for s3_object in bucket.list(prefix, delimiter='/')
31 if s3_object.key.endswith('.sha256sum')]
32 print('\n'.join(shasums))
37 parser = argparse.ArgumentParser(description='Upload SHASUMS files to GitHub')
38 parser.add_argument('-v', '--version', help='Specify the version',
40 return parser.parse_args()
43 if __name__ == '__main__':