minify before overwriting old file; oxjs removes old tree, always build geo

This commit is contained in:
j 2015-04-18 16:06:56 +05:30
parent 2ad4aad1c5
commit 0b103afeca

View file

@ -205,11 +205,7 @@ def update_static():
oxjs_build = os.path.join(settings.STATIC_ROOT, 'oxjs/tools/build/build.py') oxjs_build = os.path.join(settings.STATIC_ROOT, 'oxjs/tools/build/build.py')
if os.path.exists(oxjs_build): if os.path.exists(oxjs_build):
print 'update oxjs' print 'update oxjs'
if os.path.exists(os.path.join(settings.STATIC_ROOT, 'oxjs/min/Geo/json/Geo.json')): os.system('%s >/dev/null' % oxjs_build)
geo = '-nogeo'
else:
geo = ''
os.system('%s %s >/dev/null' % (oxjs_build, geo))
data = '' data = ''
js = [] js = []
@ -234,8 +230,8 @@ def update_static():
'png/icon.png', 'png/icon.png',
] ]
print 'write', pandora_js print 'write', pandora_js
data = ox.js.minify(data)
with open(pandora_js, 'w') as f: with open(pandora_js, 'w') as f:
data = ox.js.minify(data)
f.write(data) f.write(data)
print 'write', pandora_json print 'write', pandora_json