You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
556 B
23 lines
556 B
const yaml = require('js-yaml');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const writeOption = {
|
|
flag: 'w'
|
|
};
|
|
|
|
const writeToYml = (list, dest) => {
|
|
const data = yaml.safeDump(list);
|
|
console.log('Write to', dest);
|
|
|
|
fs.writeFileSync(dest, data, writeOption);
|
|
};
|
|
|
|
const firebaseData = require('./firebase-data.json');
|
|
|
|
['partners', 'team', 'tickets']
|
|
.forEach(key => {
|
|
const dest = path.join(__dirname, `../test-hugo/data/${key}.yml`);
|
|
const data = firebaseData[key];
|
|
writeToYml(data, dest);
|
|
});
|
|
|