fixing dev path when running in electron

This commit is contained in:
Martin McKeaveney 2020-07-15 13:42:12 +01:00
parent ec96fa0739
commit 85bf27c17b
4 changed files with 5 additions and 2 deletions

View File

@ -85,7 +85,7 @@ exports.create = async function(ctx) {
await instanceController.create(createInstCtx)
newApplication.instances.push(createInstCtx.body)
if (ctx.isDev) {
if (process.env.NODE_ENV !== "jest") {
const newAppFolder = await createEmptyAppPackage(ctx, newApplication)
await downloadExtractComponentLibraries(newAppFolder)
}

View File

@ -27,6 +27,7 @@ exports.fetchAppComponentDefinitions = async function(ctx) {
const componentJson = require(join(
appDirectory,
componentLibrary,
"package",
"components.json"
))

View File

@ -43,7 +43,8 @@ router
jwtSecret: env.JWT_SECRET,
useAppRootPath: true,
}
ctx.isDev = env.NODE_ENV !== "production" && env.NODE_ENV !== "jest"
ctx.isDev =
process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "jest"
await next()
})
.use(authenticated)

View File

@ -28,6 +28,7 @@ app.context.eventEmitter = eventEmitter
app.use(api.routes())
if (electron.app && electron.app.isPackaged) {
process.env.NODE_ENV = "production"
Sentry.init()
app.on("error", (err, ctx) => {