Skip to content

Instantly share code, notes, and snippets.

@robi42
Created February 19, 2010 12:56
Show Gist options
  • Save robi42/308673 to your computer and use it in GitHub Desktop.
Save robi42/308673 to your computer and use it in GitHub Desktop.
// Lives in: wiki-ng/db/
include('helma/file');
var data, dir = new File('Page');
dir.listFiles().forEach(function(file) {
data = JSON.parse(file.readAll());
data.revisions = [];
data.revisions.push(data.body);
delete data.body;
file.remove();
file.open();
file.write(JSON.stringify(data));
file.close();
print('Done w/ file: ' + file);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment