Portal64/tools/generate_level_list.js

20 lines
556 B
JavaScript
Raw Normal View History

2022-04-17 22:35:32 -04:00
const fs = require('fs');
const path = require('path');
function generateInclude(outputLocation, headerLocation) {
return `#include "${path.relative(path.dirname(outputLocation), headerLocation)}"`
}
function generateData(outputLocation, headerLocations) {
return `#ifndef __BUILD_LEVEL_LIST_H__
#define __BUILD_LEVEL_LIST_H__
${headerLocations.map(headerLocation => generateInclude(outputLocation, headerLocation)).join('\n')}
#endif
`;
}
const output = process.argv[2];
fs.writeFileSync(output, generateData(output, process.argv.slice(3)));