Run npm format
This commit is contained in:
@@ -5,12 +5,12 @@ import path from 'path';
|
||||
const inputDir = '../static/mapFiles/yaml';
|
||||
const outputDir = '../static/mapFiles/json';
|
||||
|
||||
if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, {recursive: true});
|
||||
if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, { recursive: true });
|
||||
|
||||
fs.readdirSync(inputDir).forEach(file => {
|
||||
if (file.endsWith('.yaml')) {
|
||||
const content = yaml.load(fs.readFileSync(path.join(inputDir, file), 'utf8'));
|
||||
const fileName = file.replace('.yaml', '.json');
|
||||
fs.writeFileSync(path.join(outputDir, fileName), JSON.stringify(content));
|
||||
}
|
||||
})
|
||||
fs.readdirSync(inputDir).forEach((file) => {
|
||||
if (file.endsWith('.yaml')) {
|
||||
const content = yaml.load(fs.readFileSync(path.join(inputDir, file), 'utf8'));
|
||||
const fileName = file.replace('.yaml', '.json');
|
||||
fs.writeFileSync(path.join(outputDir, fileName), JSON.stringify(content));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user