Skip to content

Commit

Permalink
chore: fix directory separator on windows (#2736)
Browse files Browse the repository at this point in the history
  • Loading branch information
karolsojko committed Jan 2, 2024
1 parent e6d7bce commit 5f5d817
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/services/src/Domain/HomeServer/HomeServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,6 +23,7 @@ export class HomeServerService

constructor(
private desktopDevice: DesktopDeviceInterface,
private platform: Platform,
protected override internalEventBus: InternalEventBusInterface,
) {
super(internalEventBus)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions packages/snjs/lib/Application/Dependencies/Dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,7 @@ export class Dependencies {

return new HomeServerService(
this.get<DesktopDeviceInterface>(TYPES.DeviceInterface),
this.options.platform,
this.get<InternalEventBus>(TYPES.InternalEventBus),
)
})
Expand Down

0 comments on commit 5f5d817

Please sign in to comment.