26 lines
646 B
JavaScript
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; |