Created
May 15, 2013 13:05
-
-
Save fredrikbonander/5583876 to your computer and use it in GitHub Desktop.
da
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
__author__ = 'broken' | |
import os | |
import zipfile | |
import yaml | |
from shutil import copy2 | |
def zip_directory(path, zip): | |
for root, dirs, files in os.walk(path): | |
for file in files: | |
zip.write(os.path.join(root, file)) | |
def make_zipfile(version, codename): | |
zip_file = zipfile.ZipFile('build/bedrock-%s-%s.zip' % (version, codename), 'w') | |
os.chdir('src/') | |
zip_directory('bedrock/', zip_file) | |
zip_file.close() | |
os.chdir('../') | |
copy2(zip_file.filename, 'app/') | |
def build(): | |
with open('version.yaml', 'r') as f: | |
version_config = yaml.load(f) | |
make_zipfile(version_config['version'], version_config['codename']) | |
if __name__ == '__main__': | |
build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment