generated from azures04/Base-REST-API
Added installer resources to get app icon and eula
This commit is contained in:
@@ -124,18 +124,26 @@ async function getProducts() {
|
||||
return files
|
||||
}
|
||||
|
||||
async function getRequirementsForPlatform(productName, platform) {
|
||||
async function getRequirementsForPlatform(productName, productPlatform) {
|
||||
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] || []
|
||||
const platformReqs = config.requirements?.[productPlatform] || []
|
||||
|
||||
return [...globalReqs, ...platformReqs]
|
||||
}
|
||||
|
||||
async function getInstallerResources(productName) {
|
||||
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"))
|
||||
return config["installerResources"]
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getFile,
|
||||
canAccess,
|
||||
@@ -143,5 +151,6 @@ module.exports = {
|
||||
getFileSha1,
|
||||
getProducts,
|
||||
getProductFiles,
|
||||
getInstallerResources,
|
||||
getRequirementsForPlatform
|
||||
}
|
||||
Reference in New Issue
Block a user