X-Git-Url: https://dev.renevier.net/?p=syj.git;a=blobdiff_plain;f=scripts%2Frelease.py;h=9a1b4d2959fc65726bdf282827dc35bbcc6147e8;hp=a95ddd6b6a7284b8293c104f0b35ed87a37740cf;hb=c06c7fd6e6f26d31abb8d7c9a9f9e3f2d5b27d5c;hpb=7ab93faefae14af39fc5449a2c3311dd68d2c0f9 diff --git a/scripts/release.py b/scripts/release.py index a95ddd6..9a1b4d2 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -7,6 +7,7 @@ pathjoin = os.path.join def updateversion(): try: + version = None import git repo = git.Repo('.') master = repo.commits()[0] @@ -39,7 +40,17 @@ def genscripts(): # copy scripts OpenLayers.js for path in glob.glob('public/js/*.js'): - shutil.copy(path, tmpdir) + if os.path.islink(path): + shutil.copy(path, tmpdir) + else: + # remove "use strict"; directive + with open(path) as inp: + dest = pathjoin(tmpdir, os.path.basename(path)) + with open(dest, "w") as out: + for line in inp: + sline = line.strip() + if sline != '"use strict"' and sline != '"use strict";': + out.write(line) # build OpenLayers.js subprocess.call(['python', 'buildUncompressed.py',