Skip to content

Commit

Permalink
👌 IMPROVE: auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
meetqy committed Dec 13, 2023
1 parent 203536f commit 6e18b5c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apps/electron/electron-builder/win.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const AppConfig = {
filter: ["**/*", "!**/*.node", "**/query_engine-windows.dll.node"],
},
],
publish: ["github"],
publisherName: ["meetqy"],
},
};

Expand Down
8 changes: 6 additions & 2 deletions apps/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
"version": "1.0.0-alpha.11",
"description": "远程访问 Eagle 素材资源",
"homepage": "https://rao.pics",
"repository": {
"type": "git",
"url": "https://github.com/meetqy/rao-pics.git"
},
"author": {
"name": "meetqy",
"email": "[email protected]"
},
"main": "./out/main/index.js",
"scripts": {
"build": "pnpm typecheck && pnpm with-env electron-vite build",
"build:mac": "node ./electron-builder/mac.cjs",
"build:win": "node ./electron-builder/win.cjs",
"build:mac": "pnpm with-env node ./electron-builder/mac.cjs",
"build:win": "pnpm with-env node ./electron-builder/win.cjs",
"clean": "git clean -xdf node_modules out releases .turbo",
"dev": "pnpm with-env electron-vite dev",
"format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
Expand Down
6 changes: 6 additions & 0 deletions apps/electron/src/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { join } from "path";
import { app, BrowserWindow, dialog, shell } from "electron";
import { autoUpdater } from "electron-updater";
import { electronApp, is, optimizer } from "@electron-toolkit/utils";
import * as Sentry from "@sentry/electron";
import ip from "ip";
Expand All @@ -23,6 +24,11 @@ Sentry.init({
environment: IS_DEV ? "development" : "production",
});

/** 检查更新 */
autoUpdater.checkForUpdatesAndNotify().catch((e) => {
RLogger.warning(e as Error, "autoUpdater.checkForUpdatesAndNotify");
});

RLogger.info(
`NODE_ENV: ${process.env.NODE_ENV ?? "development"}, APP_VERSION: ${
process.env.APP_VERSION ?? "0.0.0"
Expand Down

0 comments on commit 6e18b5c

Please sign in to comment.