audio-vis/build/task/jsonMinifier.js
VersusTune d1ae2059f7 WIP
2020-04-07 21:44:46 +02:00

26 lines
646 B
JavaScript

const gulp = require('gulp'),
fs = require('fs')
const basePath = __dirname + '/../../raw/gui/';
const config = {
src: basePath + '*.json',
dest: __dirname + '/../../out/gui/'
}
function build() {
fs.readdirSync(basePath).forEach(file => {
try {
if (fs.lstatSync(basePath + file).isDirectory())
return
let content = fs.readFileSync(basePath + file).toString()
fs.writeFileSync(config.dest + file, JSON.stringify(JSON.parse(content)))
} catch (e) {
console.error(e)
}
})
return gulp.src(config.src)
}
module.exports.build = build;