cli...
This commit is contained in:
parent
952074895a
commit
4247512791
|
@ -64,7 +64,7 @@ const createDevConfig = async (opts) => {
|
|||
|
||||
const initialiseDatabase = async (opts) => {
|
||||
|
||||
const appContext = await getAppContext();
|
||||
const appContext = await getAppContext({masterIsCreated:false});
|
||||
|
||||
await createMasterDb(
|
||||
appContext,
|
||||
|
|
|
@ -12,7 +12,7 @@ module.exports = ({name}) => {
|
|||
}
|
||||
|
||||
const run = async (opts) => {
|
||||
const context = await getAppContext(opts.config);
|
||||
const context = await getAppContext({configName:opts.config, masterIsCreated:true});
|
||||
const bb = await getMasterApisWithFullAccess(context);
|
||||
|
||||
const app = bb.recordApi.getNew("/applications", "application");
|
||||
|
|
|
@ -2,8 +2,9 @@ const { getAppContext } = require("../../common");
|
|||
const app = require("@budibase/server/app");
|
||||
|
||||
module.exports = ({config}) => {
|
||||
getAppContext(config).then(context => {
|
||||
app(context)
|
||||
getAppContext({configName:config, masterIsCreated:true})
|
||||
.then(context => {
|
||||
app(context);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ module.exports.serverFileName = relativePath =>
|
|||
"server",
|
||||
relativePath);
|
||||
|
||||
module.exports.getAppContext = async (configName) => {
|
||||
module.exports.getAppContext = async ({configName, masterIsCreated}) => {
|
||||
|
||||
if(configName) {
|
||||
if(!configName.endsWith(".js")) {
|
||||
|
@ -21,5 +21,5 @@ module.exports.getAppContext = async (configName) => {
|
|||
}
|
||||
|
||||
const config = require(join(cwd(), configName))();
|
||||
return await buildAppContext(config, false);
|
||||
return await buildAppContext(config, masterIsCreated);
|
||||
}
|
|
@ -6,7 +6,7 @@ const {
|
|||
const getDatastore = require("./datastore");
|
||||
const getDatabaseManager = require("./databaseManager");
|
||||
const {$, splitKey} = require("@budibase/core").common;
|
||||
const { keyBy, last, filter } = require("lodash/fp");
|
||||
const { keyBy, values } = require("lodash/fp");
|
||||
const {
|
||||
masterAppPackage,
|
||||
applictionVersionPackage,
|
||||
|
@ -34,7 +34,6 @@ module.exports = async (context) => {
|
|||
const loadApplications = async () => {
|
||||
const apps = await bb.indexApi.listItems("/all_applications");
|
||||
applications = $(apps, [
|
||||
filter(a => !!a.defaultVersion.key),
|
||||
keyBy("name")
|
||||
]);
|
||||
}
|
||||
|
@ -286,7 +285,7 @@ module.exports = async (context) => {
|
|||
await bb.recordApi.save(userInMaster);
|
||||
}
|
||||
|
||||
const listApplications = () => applications;
|
||||
const listApplications = () => values(applications);
|
||||
|
||||
|
||||
return ({
|
||||
|
|
Loading…
Reference in New Issue