mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[bugfix-922] fix linux steam pathing issue (#943)
This commit is contained in:
@@ -102,12 +102,6 @@ const gotTheLock = app.requestSingleInstanceLock();
|
||||
|
||||
const init = () => {
|
||||
initServicesMustBeInitialized();
|
||||
|
||||
if (process.platform === "linux") {
|
||||
// Properly set up the home path for linux
|
||||
const homePath = process.env.XDG_DATA_HOME || path.join(process.env.HOME, ".local", "share");
|
||||
app.setPath("home", homePath);
|
||||
}
|
||||
}
|
||||
|
||||
if (!gotTheLock) {
|
||||
|
||||
@@ -26,6 +26,7 @@ export class InstallationLocationService {
|
||||
private readonly staticConfig: StaticConfigurationService;
|
||||
private readonly updateListeners: Set<Listener> = new Set();
|
||||
|
||||
private readonly installPath: string;
|
||||
private _installationDirectory: string;
|
||||
|
||||
private constructor() {
|
||||
@@ -34,6 +35,13 @@ export class InstallationLocationService {
|
||||
this.staticConfig.$watch(this.STORE_INSTALLATION_PATH_KEY).subscribe(() => {
|
||||
this.triggerListeners();
|
||||
});
|
||||
|
||||
if (process.platform === "linux") {
|
||||
this.installPath = process.env.XDG_DATA_HOME
|
||||
|| path.join(process.env.HOME, ".local", "share");
|
||||
} else {
|
||||
this.installPath = app.getPath("home");
|
||||
}
|
||||
}
|
||||
|
||||
private triggerListeners(): void {
|
||||
@@ -65,7 +73,7 @@ export class InstallationLocationService {
|
||||
|
||||
public defaultInstallationDirectory(): string {
|
||||
const { result: oldPath } = tryit(() => path.join(app.getPath("documents"), this.INSTALLATION_FOLDER));
|
||||
const installationDirectory = (oldPath && pathExistsSync(oldPath)) ? app.getPath("documents") : app.getPath("home");
|
||||
const installationDirectory = (oldPath && pathExistsSync(oldPath)) ? app.getPath("documents") : this.installPath;
|
||||
return path.join(installationDirectory, this.INSTALLATION_FOLDER);
|
||||
}
|
||||
|
||||
@@ -85,7 +93,7 @@ export class InstallationLocationService {
|
||||
return app.getPath("documents");
|
||||
}
|
||||
|
||||
return app.getPath("home");
|
||||
return this.installPath;
|
||||
};
|
||||
|
||||
this._installationDirectory = installParentPath();
|
||||
|
||||
Reference in New Issue
Block a user