Skip to content

Commit

Permalink
chore: more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xArdi committed Jun 19, 2024
1 parent 62132d8 commit 1d8ab23
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
1 change: 1 addition & 0 deletions electron/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ module.exports = {
OperateDirectory,
OperateCmd,
Env,
appendLog,
dirs: {
VersionFile,
LogFile,
Expand Down
40 changes: 21 additions & 19 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const {
OperateCmd,
OperateDirectory,
Env,
dirs,
dirs, appendLog,
} = require('./install');
const { killProcesses } = require('./processes');
const { isPortAvailable, findAvailablePort } = require('./ports');
Expand Down Expand Up @@ -409,23 +409,23 @@ async function launchNextAppDev() {
ipcMain.on('check', async function (event, _argument) {
// Update
try {
macUpdater.checkForUpdates().then((res) => {
if (!res) return;
if (!res.downloadPromise) return;

new Notification({
title: 'Update Available',
body: 'Downloading update...',
}).show();

res.downloadPromise.then(() => {
new Notification({
title: 'Update Downloaded',
body: 'Restarting application...',
}).show();
macUpdater.quitAndInstall();
});
});
// macUpdater.checkForUpdates().then((res) => {
// if (!res) return;
// if (!res.downloadPromise) return;
//
// new Notification({
// title: 'Update Available',
// body: 'Downloading update...',
// }).show();
//
// res.downloadPromise.then(() => {
// new Notification({
// title: 'Update Downloaded',
// body: 'Restarting application...',
// }).show();
// macUpdater.quitAndInstall();
// });
// });
} catch (e) {
console.error(e);
}
Expand All @@ -436,6 +436,7 @@ ipcMain.on('check', async function (event, _argument) {
if (!isDev) {
if (platform === 'darwin') {
await setupDarwin(event.sender);
appendLog('Darwin setup complete')
} else if (platform === 'win32') {
// TODO
} else {
Expand Down Expand Up @@ -477,8 +478,9 @@ ipcMain.on('check', async function (event, _argument) {
await launchNextAppDev();
} else {
event.sender.send('response', 'Starting Pearl Daemon');
appendLog('Launching daemon')
await launchDaemon();

appendLog('Launched daemon')
event.sender.send('response', 'Starting Frontend Server');
const frontendPortAvailable = await isPortAvailable(
appConfig.ports.prod.next,
Expand Down

0 comments on commit 1d8ab23

Please sign in to comment.