2014-05-04 17:26:43 +00:00
|
|
|
import os
|
|
|
|
import ox
|
|
|
|
|
|
|
|
root_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
|
|
|
|
os.chdir(root_dir)
|
|
|
|
|
|
|
|
path = '../js/'
|
|
|
|
files = sorted([
|
|
|
|
file for file in os.listdir(path)
|
|
|
|
if not file.startswith('.')
|
|
|
|
and not file.startswith('oml.')
|
|
|
|
])
|
|
|
|
ox.file.write_json('../json/js.json', files, indent=4)
|
|
|
|
ox.file.write_file(
|
|
|
|
'%soml.min.js' % path,
|
|
|
|
'\n'.join([
|
2014-09-30 21:21:44 +00:00
|
|
|
ox.js.minify(ox.file.read_file('%s%s' % (path, file)).decode('utf-8'))
|
2014-05-04 17:26:43 +00:00
|
|
|
for file in files
|
|
|
|
])
|
|
|
|
)
|