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) await instanceController.create(createInstCtx)
newApplication.instances.push(createInstCtx.body) newApplication.instances.push(createInstCtx.body)
if (ctx.isDev) { if (process.env.NODE_ENV !== "jest") {
const newAppFolder = await createEmptyAppPackage(ctx, newApplication) const newAppFolder = await createEmptyAppPackage(ctx, newApplication)
await downloadExtractComponentLibraries(newAppFolder) await downloadExtractComponentLibraries(newAppFolder)
} }

View File

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

View File

@ -43,7 +43,8 @@ router
jwtSecret: env.JWT_SECRET, jwtSecret: env.JWT_SECRET,
useAppRootPath: true, 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() await next()
}) })
.use(authenticated) .use(authenticated)

View File

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