From 31a390b5e462ae5bed9de79ff1f93ff06eb62829 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Thu, 17 Oct 2024 15:29:47 +0200 Subject: [PATCH] Fix auto-updating --- bin/prepare_assets.sh | 15 +++++++++------ electron/helpers/apps-manager.ts | 14 +++++++------- electron/watchers/apps.ts | 6 ++++++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/bin/prepare_assets.sh b/bin/prepare_assets.sh index c863fcf..dcfa550 100755 --- a/bin/prepare_assets.sh +++ b/bin/prepare_assets.sh @@ -12,23 +12,26 @@ if [ "$(which zip)" = "" ]; then apt-get update && apt-get install -y zip fi +mv ./release/wakatime-windows-x64.exe ./release/wakatime-win32-x64.exe +mv ./release/wakatime-windows-arm64.exe ./release/wakatime-win32-arm64.exe + # add execution permission chmod 750 ./release/wakatime-linux-x86_64.AppImage chmod 750 ./release/wakatime-linux-arm64.AppImage -chmod 750 ./release/wakatime-windows-x64.exe -chmod 750 ./release/wakatime-windows-arm64.exe +chmod 750 ./release/wakatime-win32-x64.exe +chmod 750 ./release/wakatime-win32-arm64.exe # create archives zip -j ./release/wakatime-linux-x86_64.zip ./release/wakatime-linux-x86_64.AppImage zip -j ./release/wakatime-linux-arm64.zip ./release/wakatime-linux-arm64.AppImage -zip -j ./release/wakatime-windows-x64.zip ./release/wakatime-windows-x64.exe -zip -j ./release/wakatime-windows-arm64.zip ./release/wakatime-windows-arm64.exe +zip -j ./release/wakatime-win32-x64.zip ./release/wakatime-win32-x64.exe +zip -j ./release/wakatime-win32-arm64.zip ./release/wakatime-win32-arm64.exe # remove executables rm ./release/wakatime-linux-x86_64.AppImage rm ./release/wakatime-linux-arm64.AppImage -rm ./release/wakatime-windows-x64.exe -rm ./release/wakatime-windows-arm64.exe +rm ./release/wakatime-win32-x64.exe +rm ./release/wakatime-win32-arm64.exe # calculate checksums for file in ./release/*; do diff --git a/electron/helpers/apps-manager.ts b/electron/helpers/apps-manager.ts index 3353b9e..af35bbe 100644 --- a/electron/helpers/apps-manager.ts +++ b/electron/helpers/apps-manager.ts @@ -1,13 +1,13 @@ -import fs from "node:fs"; -import path from "node:path"; -import { z } from "zod"; +import { LogLevel, Logging } from "../utils/logging"; import type { AppData } from "../utils/validators"; -import { getWakatimeAppDataFolderPath } from "../utils"; -import { Logging, LogLevel } from "../utils/logging"; import { appDataSchema } from "../utils/validators"; import { excludeAppsList } from "../watchers/apps"; +import fs from "node:fs"; import { getApps } from "./installed-apps"; +import { getWakatimeAppDataFolderPath } from "../utils"; +import path from "node:path"; +import { z } from "zod"; const wakatimeAppsSchema = z.object({ installedApps: z.array(appDataSchema), @@ -115,10 +115,10 @@ export class AppsManager { static isExcludedApp(app: AppData) { return !!excludeAppsList.find((item) => { - if (item.bundleId && app.bundleId && item.bundleId === app.bundleId) { + if (item.bundleId && item.bundleId === app.bundleId) { return true; } - if (item.execName && app.execName && item.execName === app.execName) { + if (item.execName && item.execName === app.execName) { return true; } if (item.name) { diff --git a/electron/watchers/apps.ts b/electron/watchers/apps.ts index e77c013..f3213dc 100644 --- a/electron/watchers/apps.ts +++ b/electron/watchers/apps.ts @@ -284,4 +284,10 @@ export const excludeAppsList: { { name: "Electron", }, + { + name: "WakaTime", + }, + { + name: "Windows Explorer", + }, ];