2019-06-04 15:20:03 +00:00
|
|
|
var fs = require("fs");
|
2019-06-08 10:06:28 +00:00
|
|
|
var path = require('path');
|
|
|
|
var dirs = ["status-modules/cljs", "status-modules/resources"];
|
2019-06-04 15:20:03 +00:00
|
|
|
|
2019-06-08 10:06:28 +00:00
|
|
|
dirs.forEach(dir => {
|
|
|
|
fs.readdir(dir, (err, files) => {
|
|
|
|
if (files) {
|
|
|
|
files.forEach(file => {
|
|
|
|
if (file.endsWith("-raw.js")) {
|
|
|
|
const filePath = path.resolve(dir, file);
|
|
|
|
fs.readFile(filePath, "utf8", function (err, data) {
|
|
|
|
if (err) throw err;
|
|
|
|
fs.writeFile(filePath.replace("-raw.js", ".js"),
|
|
|
|
("module.exports=`" + data.replace(/[\\$'"]/g, "\\$&") + "`;"),
|
|
|
|
function (err) {
|
|
|
|
if (err) {
|
|
|
|
return console.log(err);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2019-06-04 15:20:03 +00:00
|
|
|
});
|
2019-06-08 10:06:28 +00:00
|
|
|
});
|