1
0
Fork 0
mirror of synced 2024-06-22 04:10:54 +12:00

fixing dev path when running in electron

This commit is contained in:
Martin McKeaveney 2020-07-15 13:42:12 +01:00
parent 820b9565df
commit c293d1e527
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) => {