Skip to content

Commit

Permalink
Merge pull request #47 from wakatime/bugfix/fix-auto-updating
Browse files Browse the repository at this point in the history
Fix auto-updating
  • Loading branch information
alanhamlett authored Oct 17, 2024
2 parents 32809c8 + 31a390b commit 012473c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
15 changes: 9 additions & 6 deletions bin/prepare_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions electron/helpers/apps-manager.ts
Original file line number Diff line number Diff line change
@@ -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),
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions electron/watchers/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,10 @@ export const excludeAppsList: {
{
name: "Electron",
},
{
name: "WakaTime",
},
{
name: "Windows Explorer",
},
];

0 comments on commit 012473c

Please sign in to comment.