aboutsummaryrefslogtreecommitdiff
path: root/tools/file2json.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/file2json.py')
-rw-r--r--tools/file2json.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/file2json.py b/tools/file2json.py
index 65547e72..a1c37244 100644
--- a/tools/file2json.py
+++ b/tools/file2json.py
@@ -22,5 +22,9 @@ while len(sdata) > 0:
if len(sdata) > 0:
lined += ['\n']
json = '[' + ''.join(lined) + ']'
-print json
+
+if len(sys.argv) < 3:
+ print json
+else:
+ print 'var ' + sys.argv[2] + '=' + json + ';'