2020-02-03 10:24:25 +01:00
|
|
|
const { appPackageFolder } = require("../createAppPackage")
|
|
|
|
const { writeJSON } = require("fs-extra")
|
|
|
|
const buildApp = require("./buildApp")
|
2019-09-07 07:50:35 +02:00
|
|
|
|
|
|
|
module.exports = async (config, appname, pkg) => {
|
2020-02-03 10:24:25 +01:00
|
|
|
const appPath = appPackageFolder(config, appname)
|
|
|
|
await writeJSON(`${appPath}/appDefinition.json`, pkg.appDefinition, {
|
|
|
|
spaces: 2,
|
|
|
|
})
|
2019-09-07 07:50:35 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
await writeJSON(`${appPath}/access_levels.json`, pkg.accessLevels, {
|
|
|
|
spaces: 2,
|
|
|
|
})
|
2019-09-07 07:50:35 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
await writeJSON(`${appPath}/pages.json`, pkg.pages, { spaces: 2 })
|
2019-09-07 07:50:35 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
await buildApp(config, appname, pkg.pages, pkg.appDefinition)
|
|
|
|
}
|