Skip to content

Instantly share code, notes, and snippets.

@Zegnat
Created June 23, 2014 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zegnat/ced80b06a1bd037c0731 to your computer and use it in GitHub Desktop.
Save Zegnat/ced80b06a1bd037c0731 to your computer and use it in GitHub Desktop.
"use strict";
var db = './source/db',
fs = require('fs');
fs.readdirSync(db).forEach(function (file) {
if (file.match(/^\w\w(-\w+)?-projects\.json$/)) {
fs.writeFileSync(db + '/' + file, JSON.stringify(JSON.parse(fs.readFileSync(db + '/' + file, 'utf8')), null, ' ') + "\n");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment