mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[Back-compat] Make old modules.json too for backwards compatibility
This commit is contained in:
parent
e03ca92bd9
commit
05fc0e79b1
1 changed files with 7 additions and 1 deletions
|
@ -69,6 +69,8 @@ const getGithubInfo = async (repo) => {
|
|||
return info;
|
||||
};
|
||||
|
||||
let oldTotalModulesJson = [];
|
||||
|
||||
for (const parentRepo of ModuleRepos) {
|
||||
let moduleJson = {
|
||||
modules: [],
|
||||
|
@ -90,7 +92,7 @@ for (const parentRepo of ModuleRepos) {
|
|||
|
||||
const jsHash = createHash('sha512').update(readFileSync(`${modulesDir}/${manifest.name}.js`)).digest('hex');
|
||||
|
||||
moduleJson.push({
|
||||
moduleJson.modules.push({
|
||||
name: manifest.name,
|
||||
description: manifest.description,
|
||||
version: manifest.version,
|
||||
|
@ -189,6 +191,10 @@ for (const parentRepo of ModuleRepos) {
|
|||
}
|
||||
|
||||
writeFileSync(`${distDir}/${parentRepo.filename}.json`, JSON.stringify(moduleJson));
|
||||
|
||||
oldTotalModulesJson = oldTotalModulesJson.concat(moduleJson.modules);
|
||||
}
|
||||
|
||||
writeFileSync(`${distDir}/modules.json`, JSON.stringify(oldTotalModulesJson));
|
||||
|
||||
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);
|
Loading…
Reference in a new issue