Fixed small bug in file detection in editor; fixed bug in export.
h3rald h3rald@h3rald.com
Sat, 05 Sep 2015 14:47:58 +0200
2 files changed,
8 insertions(+),
5 deletions(-)
M
admin/js/components/editor.js
→
admin/js/components/editor.js
@@ -15,7 +15,7 @@ editor.updateMode = function(filename) {
var self = this; var ext = ""; try { - ext = filename.match(/\.(.+)$/)[1]; + ext = filename.match(/\.([a-z0-9]+)$/)[1]; } catch(e) { ext = ""; }
M
lib/core.nim
→
lib/core.nim
@@ -372,15 +372,18 @@ LOG.info("Imported $1/$2 files", cFiles, files.len)
proc exportDir*(store: Datastore, dir: string) = let docs = store.db.getAllRows(SQL_SELECT_DOCUMENTS_BY_TAG, "$dir:"&dir) + LOG.info("Exporting $1 files...", docs.len) for doc in docs: - let file = doc[0].unixToNativePath + LOG.debug("Exporting: $1", doc[1]) + let file = doc[1].unixToNativePath var data: string - if doc[3].parseInt == 1: - data = doc[1].decode + if doc[4].parseInt == 1: + data = doc[2].decode else: - data = doc[1] + data = doc[2] file.parentDir.createDir file.writeFile(data) + LOG.info("Done."); proc deleteDir*(store: Datastore, dir: string) = store.db.exec(SQL_DELETE_DOCUMENTS_BY_TAG, "$dir:"&dir)