Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto-updating #47

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
},
];
Loading