mirror of
https://github.com/Pandipipas/scoreko-electron-dev.git
synced 2026-06-06 05:32:06 +00:00
Make userData directory configurable via env (#36)
This commit is contained in:
+4
-2
@@ -9,6 +9,10 @@ import { createLoadingWindow, createMainWindow } from "./windows/window-factory"
|
||||
|
||||
const appConfig = getRuntimeConfig();
|
||||
|
||||
// Force a stable userData folder name; overridable via SCOREKO_APP_USER_DATA_DIRECTORY.
|
||||
app.setName(appConfig.title);
|
||||
app.setPath("userData", path.join(app.getPath("appData"), appConfig.userDataDirectoryName));
|
||||
|
||||
const isDev = !app.isPackaged;
|
||||
const rootPath = isDev ? path.resolve(__dirname, "../..") : process.resourcesPath;
|
||||
const nodecgRootPath = path.resolve(rootPath, "lib", "nodecg");
|
||||
@@ -96,8 +100,6 @@ function stopNodecgGracefully(): Promise<void> {
|
||||
}
|
||||
|
||||
app.on("ready", () => {
|
||||
app.setName(appConfig.title);
|
||||
|
||||
if (process.platform === "win32") {
|
||||
app.setAppUserModelId(appConfig.userModelId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user