1
0
Fork 0
mirror of synced 2024-10-03 19:43:32 +13:00

adding dialog import

This commit is contained in:
Martin McKeaveney 2020-07-13 18:11:19 +01:00
parent 1c6897e3f2
commit f790a51156
3 changed files with 10 additions and 10 deletions

View file

@ -1,4 +1,4 @@
const { app, BrowserWindow, shell } = require("electron")
const { app, BrowserWindow, shell, dialog } = require("electron")
const { join } = require("path")
const isDev = require("electron-is-dev")
const { autoUpdater } = require("electron-updater")
@ -72,10 +72,11 @@ autoUpdater.on("update-downloaded", (event, releaseNotes, releaseName) => {
buttons: ["Restart", "Later"],
title: "Budibase Update Available",
message: process.platform === "win32" ? releaseNotes : releaseName,
detail: "A new version of the budibase builder has been downloaded. Restart the application to apply the updates."
detail:
"A new version of the budibase builder has been downloaded. Restart the application to apply the updates.",
}
dialog.showMessageBox(dialogOpts).then((returnValue) => {
dialog.showMessageBox(dialogOpts).then(returnValue => {
if (returnValue.response === 0) autoUpdater.quitAndInstall()
})
})
@ -85,5 +86,4 @@ autoUpdater.on("error", message => {
console.error(message)
})
startApp();
startApp()

View file

@ -1,9 +1,9 @@
const { resolve, join } = require("path")
const { homedir } = require("os");
const { app } = require("electron");
const { homedir } = require("os")
const { app } = require("electron")
async function runServer() {
const homeDir = app ? app.getPath("home") : homedir();
const homeDir = app ? app.getPath("home") : homedir()
const budibaseDir = join(homeDir, ".budibase")
process.env.BUDIBASE_DIR = budibaseDir