budibase/packages/server/utilities/builder/savePackage.js

19 lines
566 B
JavaScript
Raw Normal View History

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) => {
const appPath = appPackageFolder(config, appname)
await writeJSON(`${appPath}/appDefinition.json`, pkg.appDefinition, {
spaces: 2,
})
2019-09-07 07:50:35 +02:00
await writeJSON(`${appPath}/access_levels.json`, pkg.accessLevels, {
spaces: 2,
})
2019-09-07 07:50:35 +02:00
await writeJSON(`${appPath}/pages.json`, pkg.pages, { spaces: 2 })
2019-09-07 07:50:35 +02:00
await buildApp(config, appname, pkg.pages, pkg.appDefinition)
}