mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-11-13 15:09:20 +01:00
feat(path): enhance path resolution for resources and user themes based on app context
This commit is contained in:
@@ -16,10 +16,12 @@ const ext = isWindows ? '.exe' : ''
|
|||||||
/** Centralized resource paths */
|
/** Centralized resource paths */
|
||||||
const resourcesPath = config.devMode
|
const resourcesPath = config.devMode
|
||||||
? path.join(__dirname, "../../resources")
|
? path.join(__dirname, "../../resources")
|
||||||
: process.resourcesPath;
|
: (process.resourcesPath || path.join(__dirname, "../../resources"));
|
||||||
|
|
||||||
/** Default download folder (centralized) */
|
/** Default download folder (centralized) */
|
||||||
const defaultDownloadFolder = path.join(app.getPath("downloads"), "Freedom Loader");
|
const defaultDownloadFolder = app && typeof app.getPath === "function"
|
||||||
|
? path.join(app.getPath("downloads"), "Freedom Loader")
|
||||||
|
: path.join(process.env.HOME || process.cwd(), "Downloads", "Freedom Loader");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current platform:
|
* Current platform:
|
||||||
@@ -149,7 +151,9 @@ const binaryPaths = {
|
|||||||
* - default themes come from app resources
|
* - default themes come from app resources
|
||||||
* - user themes are persisted in userData to survive updates
|
* - user themes are persisted in userData to survive updates
|
||||||
*/
|
*/
|
||||||
const userThemesPath = path.join(app.getPath("userData"), "themes");
|
const userThemesPath = app && typeof app.getPath === "function"
|
||||||
|
? path.join(app.getPath("userData"), "themes")
|
||||||
|
: path.join(process.env.HOME || process.cwd(), ".config", "Freedom Loader", "themes");
|
||||||
const defaultThemesSourcePath = path.join("theme");
|
const defaultThemesSourcePath = path.join("theme");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user