Преглед на файлове

Remove brew special casing

Brew Formulae support an `auto_updates true` flag which tells brew's auto update
mechanism to stay out of the way.

Ref: https://docs.brew.sh/FAQ#why-arent-some-apps-included-during-brew-upgrade

Will need to open a PR to update our Formula though.

https://github.com/Homebrew/homebrew-cask/blob/9241d331b69abd5af47332488ba1857075cb99fd/Casks/e/ente.rb#L9
Manav Rathi преди 1 година
родител
ревизия
95eec1f3d6
променени са 2 файла, в които са добавени 4 реда и са изтрити 17 реда
  1. 3 2
      desktop/src/main.ts
  2. 1 15
      desktop/src/main/init.ts

+ 3 - 2
desktop/src/main.ts

@@ -19,7 +19,6 @@ import {
     handleDockIconHideOnAutoLaunch,
     handleDownloads,
     handleExternalLinks,
-    handleUpdates,
     logStartupBanner,
     setupMacWindowOnDockIconClick,
     setupMainMenu,
@@ -27,6 +26,8 @@ import {
 } from "./main/init";
 import { attachFSWatchIPCHandlers, attachIPCHandlers } from "./main/ipc";
 import log, { initLogging } from "./main/log";
+import { isDev } from "./main/util";
+import { setupAutoUpdater } from "./services/appUpdater";
 import { initWatcher } from "./services/chokidar";
 
 let appIsQuitting = false;
@@ -170,7 +171,7 @@ const main = () => {
         setupMainMenu(mainWindow);
         attachIPCHandlers();
         attachFSWatchIPCHandlers(watcher);
-        await handleUpdates(mainWindow);
+        if (!isDev) setupAutoUpdater(mainWindow);
         handleDownloads(mainWindow);
         handleExternalLinks(mainWindow);
         addAllowOriginHeader(mainWindow);

+ 1 - 15
desktop/src/main/init.ts

@@ -9,7 +9,7 @@ import { getHideDockIconPreference } from "../services/userPreference";
 import { isPlatform } from "../utils/common/platform";
 import { buildContextMenu, buildMenuBar } from "../utils/menu";
 import log from "./log";
-import { execAsync, isDev } from "./util";
+import { isDev } from "./util";
 
 /**
  * Create an return the {@link BrowserWindow} that will form our app's UI.
@@ -79,10 +79,6 @@ export const createWindow = async () => {
 };
 
 export async function handleUpdates(mainWindow: BrowserWindow) {
-    const isInstalledViaBrew = await checkIfInstalledViaBrew();
-    if (!isDev && !isInstalledViaBrew) {
-        setupAutoUpdater(mainWindow);
-    }
 }
 
 export const setupTrayItem = (mainWindow: BrowserWindow) => {
@@ -170,16 +166,6 @@ export function logStartupBanner() {
     log.debug(() => ({ platform, osRelease, systemVersion }));
 }
 
-async function checkIfInstalledViaBrew() {
-    if (process.platform != "darwin") return false;
-    try {
-        await execAsync("brew list --cask ente");
-        return true;
-    } catch (e) {
-        return false;
-    }
-}
-
 function lowerCaseHeaders(responseHeaders: Record<string, string[]>) {
     const headers: Record<string, string[]> = {};
     for (const key of Object.keys(responseHeaders)) {