Remove use of __dirname from main process

This commit is contained in:
Fedor Indutny
2026-03-27 10:55:37 -07:00
committed by GitHub
parent 70f111e868
commit a048f83dbc
39 changed files with 222 additions and 337 deletions

View File

@@ -3,32 +3,10 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import type { PackageJsonType } from '../types/packageJson.d.ts';
const PACKAGE_JSON_PATH = join(__dirname, '..', '..', 'package.json');
const json: {
name: string;
version: string;
productName: string;
build: {
appId: string;
mac: {
releaseInfo: {
vendor: {
minOSVersion: string;
};
};
};
deb: {
depends: Array<string>;
};
files: Array<string | Record<string, unknown>>;
};
} = JSON.parse(readFileSync(PACKAGE_JSON_PATH, 'utf8'));
export default json;
export const { name } = json;
export const { version } = json;
export const { productName } = json;
export const { build } = json;
export const packageJson: PackageJsonType = JSON.parse(
readFileSync(PACKAGE_JSON_PATH, 'utf8')
);