Skip to content

Commit

Permalink
Merge pull request #166 from kinvolk/fix-how-we-check-dev-mode
Browse files Browse the repository at this point in the history
app: Update how we check dev mode for desktop app
  • Loading branch information
ashu8912 authored Jan 13, 2021
2 parents 8625dbf + bacab83 commit 26b61f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ function startElecron() {
const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);

const isDev = process.mainModule.filename.indexOf('app.asar') === -1 ||
process.mainModule.filename.indexOf('app') === -1;
const isDev = process.env.ELECTRON_DEV || false;

function createWindow () {
const startUrl = process.env.ELECTRON_START_URL || url.format({
Expand Down
7 changes: 5 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "npm run copy-server-binary && cd ../ && make run-backend & cd ../frontend/ && export BROWSER=none && npm start",
"build": "npm run copy-server-binary && cd ../frontend/ && PUBLIC_URL='./' npm run build && cp -r ../app/electron/. build/electron",
"package": "mkdir -p build && cp -r ../frontend/build/* ./build && electron-builder build -c.extraMetadata.main=build/electron/main.js --publish never",
"serve-dev": "export ELECTRON_START_URL=http://localhost:3000 && electron .",
"serve-dev": "export ELECTRON_DEV=1 && export ELECTRON_START_URL=http://localhost:3000 && electron .",
"publish": "mkdir -p build && cp -r ../frontend/build/* ./build && electron-builder build -c.extraMetadata.main=build/electron/main.js --publish always"
},
"build": {
Expand Down Expand Up @@ -48,7 +48,10 @@
"../frontend/node_modules/**/*",
"node_modules/**/*"
],
"extraResources": ["./electron/server","./electron/server.exe"],
"extraResources": [
"./electron/server",
"./electron/server.exe"
],
"extraFiles": [
{
"from": "../frontend/build",
Expand Down

0 comments on commit 26b61f8

Please sign in to comment.