mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
desktop: fix resources directory path in release build
This commit is contained in:
committed by
Abdullah Atta
parent
22fff296b5
commit
fb56206537
@@ -36,9 +36,12 @@ type FlexibleIcon<TFormat extends Formats> = TFormat extends "ico"
|
||||
? string
|
||||
: NativeImage;
|
||||
|
||||
const APP_DIR = isDevelopment()
|
||||
const RESOURCES_DIR = isDevelopment()
|
||||
? process.cwd()
|
||||
: path.dirname(process.execPath);
|
||||
: path.join(
|
||||
path.dirname(process.execPath),
|
||||
process.platform === "darwin" ? "Resources" : "resources"
|
||||
);
|
||||
|
||||
const prefixes = ["", ".dark"];
|
||||
const icons = ["note-add", "notebook-add", "reminder-add", "quit"] as const;
|
||||
@@ -56,7 +59,7 @@ export class AssetManager {
|
||||
for (const prefix of prefixes) {
|
||||
for (const icon of icons) {
|
||||
const icoPath = path.join(
|
||||
APP_DIR,
|
||||
RESOURCES_DIR,
|
||||
"assets",
|
||||
"icons",
|
||||
`${icon}${prefix}.ico`
|
||||
@@ -86,7 +89,7 @@ export class AssetManager {
|
||||
const prefix: Prefixes = nativeTheme.shouldUseDarkColors ? ".dark" : "";
|
||||
|
||||
const icoPath = path.join(
|
||||
APP_DIR,
|
||||
RESOURCES_DIR,
|
||||
"assets",
|
||||
"icons",
|
||||
`${name}${prefix}.ico`
|
||||
|
||||
Reference in New Issue
Block a user