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

fix: guardoni electron dmg build and default paths #387

Merged
merged 3 commits into from
Feb 11, 2022
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
4 changes: 4 additions & 0 deletions guardoni/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ linux:
target: ['deb']
category: Network

mac:
target: ['dmg']
category: 'public.app-category.utilities'

win:
target: ['portable']
14 changes: 10 additions & 4 deletions guardoni/src/electron/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
export const DEFAULT_BASE_PATH = process.cwd();
import os from 'os';
import * as path from 'path';

export const DEFAULT_BASE_PATH = path.resolve(
os.homedir(),
'.guardoni/electron'
);
export const DEFAULT_SERVER = 'https://youtube.tracking.exposed/api';
export const DEFAULT_EXTENSION_DIR = [
export const DEFAULT_EXTENSION_DIR = path.resolve(
DEFAULT_BASE_PATH,
'build/extension',
].join('/');
'extension'
);

export const DEFAULT_LOAD_FOR = 3000;
6 changes: 4 additions & 2 deletions guardoni/src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import { AppEnv } from '../AppEnv';
import { GetEvents } from './events/renderer.events';
import { createGuardoniWindow } from './windows/GuardoniWindow';
import packageJson from '../../package.json';
import { DEFAULT_BASE_PATH } from './config';

app.setAppLogsPath(path.resolve(os.homedir(), `.config/guardoni/logs`));
app.setPath('userData', path.resolve(os.homedir(), `.config/guardoni/data`));
app.setPath('userData', path.resolve(os.homedir(), `.guardoni/electron/data`));
app.setAppLogsPath(path.resolve(os.homedir(), `.guardoni/electron/logs`));

// load env from .env file shipped with compiled code
dotenv.config({
Expand Down Expand Up @@ -109,6 +110,7 @@ export const run = async (): Promise<void> => {
headless: true,
verbose: false,
backend: env.BACKEND,
basePath: DEFAULT_BASE_PATH,
},
}).register();
})
Expand Down