fixing dev path when running in electron
This commit is contained in:
parent
ec96fa0739
commit
85bf27c17b
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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) => {
|
||||||
|
|
Loading…
Reference in New Issue