]> dev.renevier.net Git - syj.git/blobdiff - scripts/release.py
add mapquest layer back
[syj.git] / scripts / release.py
index a95ddd6b6a7284b8293c104f0b35ed87a37740cf..9a1b4d2959fc65726bdf282827dc35bbcc6147e8 100755 (executable)
@@ -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',