X-Git-Url: https://dev.renevier.net/?p=syj.git;a=blobdiff_plain;f=scripts%2Frelease.py;h=9a1b4d2959fc65726bdf282827dc35bbcc6147e8;hp=a567d8539bc2d455cedc74d7f4ee63812113992a;hb=c06c7fd6e6f26d31abb8d7c9a9f9e3f2d5b27d5c;hpb=19ff9487d2670d5043eed539b7358b8d6f86d1fc diff --git a/scripts/release.py b/scripts/release.py index a567d85..9a1b4d2 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -40,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',