init commit
This commit is contained in:
14
build/generate.js
Normal file
14
build/generate.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
let order = fs.readFileSync(path.join(__dirname, '../data/order.json'), 'utf8');
|
||||
order = JSON.parse(order);
|
||||
|
||||
let holidayList = [];
|
||||
for (let holidayId of order) {
|
||||
let holiday = fs.readFileSync(path.join(__dirname, `../data/holiday/${holidayId}.json`), 'utf8');
|
||||
holiday = JSON.parse(holiday);
|
||||
holidayList.push(holiday);
|
||||
}
|
||||
fs.writeFileSync(path.join(__dirname, `../holiday.min.json`), JSON.stringify(holidayList));
|
||||
fs.writeFileSync(path.join(__dirname, `../holiday.json`), JSON.stringify(holidayList, null, 4));
|
Reference in New Issue
Block a user