generated from azures04/Base-REST-API
Added requirements supports
- Added requirements support to make easier the installation of my softs
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user