Added requirements supports

-  Added requirements support to make easier the installation of my softs
This commit is contained in:
2026-02-08 00:52:39 +01:00
parent ac12432ebd
commit 677e23d755
2 changed files with 26 additions and 1 deletions

View File

@@ -124,11 +124,24 @@ async function getProducts() {
return files
}
async function getRequirementsForPlatform(productName, platform) {
const fixedPath = path.join(productsDataPath, productName, "files", ".brikcfg")
if (!(await fs.promises.exists(fixedPath))) return []
const config = JSON.parse(await fs.promises.readFile(fixedPath, "utf8"))
const globalReqs = config.requirements?.global || []
const platformReqs = config.requirements?.[platform] || []
return [...globalReqs, ...platformReqs]
}
module.exports = {
getFile,
canAccess,
getProduct,
getFileSha1,
getProducts,
getProductFiles
getProductFiles,
getRequirementsForPlatform
}