Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Commit f5dccd6

Browse files
committed
fix: guardoni electron dmg build and default paths (#387)
1 parent ade62f5 commit f5dccd6

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

guardoni/electron-builder.yml

+4
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,9 @@ linux:
2727
target: ['deb']
2828
category: Network
2929

30+
mac:
31+
target: ['dmg']
32+
category: 'public.app-category.utilities'
33+
3034
win:
3135
target: ['portable']

guardoni/src/electron/config.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
export const DEFAULT_BASE_PATH = process.cwd();
1+
import os from 'os';
2+
import * as path from 'path';
3+
4+
export const DEFAULT_BASE_PATH = path.resolve(
5+
os.homedir(),
6+
'.guardoni/electron'
7+
);
28
export const DEFAULT_SERVER = 'https://youtube.tracking.exposed/api';
3-
export const DEFAULT_EXTENSION_DIR = [
9+
export const DEFAULT_EXTENSION_DIR = path.resolve(
410
DEFAULT_BASE_PATH,
5-
'build/extension',
6-
].join('/');
11+
'extension'
12+
);
713

814
export const DEFAULT_LOAD_FOR = 3000;

guardoni/src/electron/main.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ import { AppEnv } from '../AppEnv';
1616
import { GetEvents } from './events/renderer.events';
1717
import { createGuardoniWindow } from './windows/GuardoniWindow';
1818
import packageJson from '../../package.json';
19+
import { DEFAULT_BASE_PATH } from './config';
1920

20-
app.setAppLogsPath(path.resolve(os.homedir(), `.config/guardoni/logs`));
21-
app.setPath('userData', path.resolve(os.homedir(), `.config/guardoni/data`));
21+
app.setPath('userData', path.resolve(os.homedir(), `.guardoni/electron/data`));
22+
app.setAppLogsPath(path.resolve(os.homedir(), `.guardoni/electron/logs`));
2223

2324
// load env from .env file shipped with compiled code
2425
dotenv.config({
@@ -109,6 +110,7 @@ export const run = async (): Promise<void> => {
109110
headless: true,
110111
verbose: false,
111112
backend: env.BACKEND,
113+
basePath: DEFAULT_BASE_PATH,
112114
},
113115
}).register();
114116
})

0 commit comments

Comments
 (0)