From 5f5d817e04d8c8ca87e321ad9e408f1371496c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Tue, 2 Jan 2024 10:02:11 +0100 Subject: [PATCH] chore: fix directory separator on windows (#2736) --- packages/services/src/Domain/HomeServer/HomeServerService.ts | 5 ++++- packages/snjs/lib/Application/Dependencies/Dependencies.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/services/src/Domain/HomeServer/HomeServerService.ts b/packages/services/src/Domain/HomeServer/HomeServerService.ts index 09a4503cf..2d6b434fe 100644 --- a/packages/services/src/Domain/HomeServer/HomeServerService.ts +++ b/packages/services/src/Domain/HomeServer/HomeServerService.ts @@ -13,6 +13,7 @@ import { RawStorageKey } from '../Storage/StorageKeys' import { HomeServerServiceInterface } from './HomeServerServiceInterface' import { HomeServerEnvironmentConfiguration } from './HomeServerEnvironmentConfiguration' import { HomeServerStatus } from './HomeServerStatus' +import { Platform } from '@standardnotes/models' export class HomeServerService extends AbstractService @@ -22,6 +23,7 @@ export class HomeServerService constructor( private desktopDevice: DesktopDeviceInterface, + private platform: Platform, protected override internalEventBus: InternalEventBusInterface, ) { super(internalEventBus) @@ -173,7 +175,8 @@ export class HomeServerService if (!documentsDirectory) { return } - location = `${documentsDirectory}/${this.HOME_SERVER_DATA_DIRECTORY_NAME}` + const separator = this.platform === Platform.WindowsDesktop ? '\\' : '/' + location = `${documentsDirectory}${separator}${this.HOME_SERVER_DATA_DIRECTORY_NAME}` } await this.desktopDevice.setRawStorageValue(RawStorageKey.HomeServerDataLocation, location) diff --git a/packages/snjs/lib/Application/Dependencies/Dependencies.ts b/packages/snjs/lib/Application/Dependencies/Dependencies.ts index a9f15520a..ea5345ce3 100644 --- a/packages/snjs/lib/Application/Dependencies/Dependencies.ts +++ b/packages/snjs/lib/Application/Dependencies/Dependencies.ts @@ -1187,6 +1187,7 @@ export class Dependencies { return new HomeServerService( this.get(TYPES.DeviceInterface), + this.options.platform, this.get(TYPES.InternalEventBus), ) })