Skip to content

Commit

Permalink
Update script to create release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Nouidui committed Apr 14, 2016
1 parent 5d7dc6f commit 5714ba3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bin/createPostRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,34 @@ def quitWithError(messageStr, showCmdLine):
from contextlib import closing
from zipfile import ZipFile, ZIP_DEFLATED
import os
import sys

def zipdir(basedir, archivename):
n_gits=0
n_md=0
assert os.path.isdir(basedir)
with closing(ZipFile(archivename, "w", ZIP_DEFLATED)) as z:
for root, dirs, files in os.walk(basedir):
#NOTE: ignore empty directories
if '.git' in dirs:
n_gits=n_gits+1
print "found .git folder in " + str(dirs)
#continue
dirs.remove('.git')
for fn in files:
if (fn.endswith('.md')):
absfn = os.path.join(root, fn)
print "found file with extension '.md'. The file is in " + absfn
n_md=n_md+1
continue
else:
absfn = os.path.join(root, fn)
zfn = absfn[len(basedir) + len(os.sep):]
z.write(absfn, zfn)
if(n_md>1):
print "found more than one file (" + str(n_md) + ")" + " with extension .md. Program terminated."
sys.exit()


if __name__ == '__main__':
import sys
Expand Down

0 comments on commit 5714ba3

Please sign in to comment.