From 300427830775046ce6ae57b4877eac34a17c603d Mon Sep 17 00:00:00 2001 From: phan Date: Tue, 7 May 2024 05:53:11 -0400 Subject: [PATCH] dev update --- dev-app-update.yml | 5 +++++ package.json | 1 + src/main/index.ts | 5 +++++ src/renderer/src/app/app.tsx | 2 +- src/shared/utils.ts | 10 ---------- 5 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 dev-app-update.yml diff --git a/dev-app-update.yml b/dev-app-update.yml new file mode 100644 index 0000000..a9ea411 --- /dev/null +++ b/dev-app-update.yml @@ -0,0 +1,5 @@ +publish: + provider: github + repo: anime.gf-dev + owner: cyanff + vPrefixedTagName: false \ No newline at end of file diff --git a/package.json b/package.json index 4648eb2..1300a76 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "agf", + "version": "0.0.0", "description": "An Electron application with React and TypeScript", "homepage": "https://anime.gf", "author": "anime.gf", diff --git a/src/main/index.ts b/src/main/index.ts index 9d280da..13536f3 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -40,6 +40,11 @@ app.whenReady().then(async () => { } electronApp.setAppUserModelId("gf.anime"); + // Set the update config path to the dev-app-update.yml in development + if (is.dev) { + autoUpdater.updateConfigPath = path.join(process.cwd(), "dev-app-update.yml"); + } + // https://stackoverflow.com/questions/37828758/electron-js-how-to-minimize-close-window-to-system-tray-and-restore-window-back const tray = new Tray(nativeImage.createFromPath(icon)); const contextMenu = Menu.buildFromTemplate([ diff --git a/src/renderer/src/app/app.tsx b/src/renderer/src/app/app.tsx index a196b09..7b53537 100644 --- a/src/renderer/src/app/app.tsx +++ b/src/renderer/src/app/app.tsx @@ -122,7 +122,7 @@ export default function App() { }} >
{ e.preventDefault(); diff --git a/src/shared/utils.ts b/src/shared/utils.ts index f50d067..318c61d 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -22,16 +22,6 @@ export function deepFreeze(object: any) { return Object.freeze(object); } -export async function fileExists(path: string) { - try { - await fsp.access(path); - return true; - } catch { - // File doesn't exist or not accessible (e.g. no permissions) - return false; - } -} - /** * Remove all top level properties matching the blacklist from an object * @param obj The object to clone and remove properties from